-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Rick,
Intransition,

thanks for your answers!

On Tuesday 15 June 2010, Rick DeNatale <rick.denatale / gmail.com> wrote:
> > Now I'm not quite sure why. I know that require() is a statement like
> > puts in regards of its execution time, i.e. there's no special
> > treatment in some parse/compile/whatever phase before the actual
> > execution begins. As such, it seems logic that I get the missing symbol
> > error with the original code: Foo::A is not defined when the derivation
> > is made, and as such, putting require 'a/b' some lines later helps.
> >
> > Am I correct with this explanation?
> 
> Yes

Ok, that's a start. :-)

I haven't read a lot of Ruby code so far, but from what I've looked at, I 
could see that require() typically goes at the top of the file. Seems to be 
some sort of (unwritten?) coding style guideline to me. I'm always hestitant 
to write code that at seems to be outside of the best practices pathway. So 
the obvious question is: Am I right with the assumption, that issuing a 
require statement somewhere within the class or method is not quite a good 
style? (For a similar reason I'd like to avoid the autoloader, too, besides 
the problems it has.)

If so, I'm quite obviously creating a flawed design. What's the 
recommendation in this case? 

TIA!

			Eric
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkwXkVUACgkQhS0drJ3goJLapQCeMUgjoqulj4KdqX3gTrQEQAOK
1ukAn0017I/xUy75x8o71C9mrfl+JV70
=2tvl
-----END PGP SIGNATURE-----