On Tue, Nov 25, 2008 at 8:34 AM, Zach D. [email protected]
Nevertheless, I regard the practice as a bit of
an affection - ‘look at me, ma, I’m opening the eigenclass!’ - or as the
imitation of an affection. It confuses newbies to no purpose, and
everyone when ‘class << self’ has scrolled off the top of the screen.
A lot of things confuse newbies. I don’t think that’s a very good
point for why you don’t do something.
I believe potential confusion is a good argument against something,
paribus. However, as I indicated at the end of my message, ceteri are
always paribi. In other words, we all do things that would confuse
but (like #each) they have obvious benefits. That’s why we use them.
Educating people so they understand why and when it should be avoided
Well, sure, but I’m just talking about cutting some code, here, not
a blog article.
is better then raising a fire alarm (unless it’s really a fire).
Contrary to your statement though, I don’t use class << self to feel
special, and my ma could care less about how I code.
Sorry! I didn’t mean to seem like I was addressing you personally, Zach.
fact, I was thinking of a blog entry I read the other day where a single
method was enclosed in ‘class << self.’ The only reason I could think of
that was 1) because it looked cool to the author, or 2) he thought it
look cool to others. It just looked like a couple of lines of wasted
I don’t know about any fire alarms - I think the important thing to
is what benefits the practice has. In most cases I’ve seen, there aren’t
any, and it does have the disadvantages I mentioned.