Best way to require your classes

is it better to create a single script that requires all the files your app
needs. or to have each file require the files it depends on?

ex. 1

myprogram.rb
require ‘class1’

class1.rb
require ‘class2’

class2.rb

ex. 2

myprogram.rb
require class1.rb
require class2.rb

class1.rb

class2.rb

···


tom sawyer, aka transami
transami@transami.net

Each as needed-- even if it’s likely whatever script calls it has already
required the library. This is for for re-use, and so that you can test each
script separately, if so desired (modularity), without the ‘parent’ script.

That’s how I approach it, anyhow.

// Bruce

···

On Thursday 23 January 2003 01:33 am, Tom Sawyer wrote:

is it better to create a single script that requires all the files your app
needs. or to have each file require the files it depends on?


Bruce R. Williams :: [iusris/#ruby-lang] :: http://www.codedbliss.com

‘It does not require a majority to prevail, but rather an irate,
tireless minority keen to set brush fires in people’s minds.’
– Samuel Adams