Really Dumbfounded About Ruby Devs and Comments
Yesterday a co-worker re-tweeted this tweet from someone I don't know - but I've heard this attitude so many times in the past three months, it's really quite shocking:
Don't write comments explaining what your code does. Most programmers can read code. Tell me *why* it does it, but only if necessary.
— Bruno Miranda (@brupm) October 15, 2012
This is what I've come to call the Rubist's Aversion to Comments.
I had a discussion with another co-worker today just before he left, and his points were this:
- Ruby coders don't like comments - they see it as "unmaintained fluff" in the code files. That it's possible to maintain the comments as well as the code, seems completely foreign to them, and when I pointed that out, they seem to simply poo-poo it as a silly notion.
- Ruby coders like pairing - his argument is that pairing is better than comments because more people understand the code. When I mentioned that well written documentation serves the same purpose, it was again poo-pooed.
I think the problem is that for the most part, Ruby coders like good docs - like the Ruby Docs, but they don't like to write them. I think this is just because they want to be lazy, and come up with all kinds of excuses to justify the lack of comments. In short, I think it's just immaturity.
When I responded:
@brupm @mikelikesbikes I've learned that after 38 yrs in this business the "Why" is "Because", and you write good docs all the time. Period.
— Bob Beaty (@drbobbeaty) October 15, 2012
his response was:
@drbobbeaty @mikelikesbikes honestly that makes no sense to me. The *why* is, you intention for the piece of code. Not *why* you did it.
— Bruno Miranda (@brupm) October 15, 2012
I get it… there was a time I didn't write comments - but that was when I was writing games for myself and I was a teenager. When I got serious about this profession, I wrote comments. Always.
But that's not the world I'm in these days. I'm dealing with a lot of folks that see comments as a bad thing - certainly something a good coder can do without. After all, if the code is really well done then it's self-documenting (an impossibility for any complex system). So the Holy Grail of a Ruby coder seems to be to never write a line of comments.
I wonder how many of them will think this in 15 years?