J
Jeff
I noticed that Rails core is adopting a style of using an underscore
at the start of an ivar name, like @_env. (see the short thread at
http://groups.google.com/group/rubyonrails-core/browse_thread/thread/a45de7e435c6c22a)
I kind of hate leading underscores. They remind me of my C++
days
The reasoning sounds logical enough: for ivars that are
supposed to be "private" the class/module, it helps avoid naming
conflicts with client code that includes/derives from that module or
class that wants to keep "it's own" ivars.
But I haven't seen anyone else need to do this in their modules/
classes, so now I'm wondering - has anyone else needed to do this? It
seems like this would be a common problem for any shared Ruby library,
so now I'm wondering why I *haven't* run into this before.
Jeff
at the start of an ivar name, like @_env. (see the short thread at
http://groups.google.com/group/rubyonrails-core/browse_thread/thread/a45de7e435c6c22a)
I kind of hate leading underscores. They remind me of my C++
days
supposed to be "private" the class/module, it helps avoid naming
conflicts with client code that includes/derives from that module or
class that wants to keep "it's own" ivars.
But I haven't seen anyone else need to do this in their modules/
classes, so now I'm wondering - has anyone else needed to do this? It
seems like this would be a common problem for any shared Ruby library,
so now I'm wondering why I *haven't* run into this before.
Jeff