[rspec-users] class << self considered harmful... really?
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.
Developer Blog: http://avdi.org/devblog/
More information about the rspec-users