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

Mark Wilden mark at mwilden.com
Tue Nov 25 12:54:38 EST 2008

On Tue, Nov 25, 2008 at 8:54 AM, Matt Wynne <matt at mattwynne.net> wrote:

> Surely, as soon as they scroll off the screen, it's time to factor that
> code off into a module or class of its own though?

That's assuming there are a lot of class methods. There might be only one,
but if that 'class << self' is off the screen, there's the potential for
confusion (among noobs and gurus alike). In many if not most cases I've
seen, there were no counterbalancing benefits.

For more, see The Ruby Programming Language for their take.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20081125/efa9816f/attachment.html>

More information about the rspec-users mailing list