[rspec-users] class << self considered harmful... really?

Avdi Grimm avdi at avdi.org
Sun Nov 30 16:44:22 EST 2008

On Sun, Nov 30, 2008 at 4:39 PM, Avdi Grimm <avdi at avdi.org> wrote:
>  I don't think it's a practice worth promulgating.

...not to mention that most noob Ruby programmers learned to use def
self.foo (or def ClassName.foo, if they are reading the 1st edition
pickaxe online), and coming across that class << self block is
confusing and gives them the (false) idea they have to understand
about singleton classes just to comprehend what's going on in the
code.  Keep it simple.


Home: http://avdi.org
Developer Blog: http://avdi.org/devblog/
Twitter: http://twitter.com/avdi
Journal: http://avdi.livejournal.com

More information about the rspec-users mailing list