Just this morning, I have read three different blog posts about why people should not be commenting their code (ok, that's not exactly what he was saying, but it is what the blog post title implied). Most of you know that I am strongly against this idea, and as you can see from my public code, I put a large amount of comments in my code. After reading Brian Kotek's "Don't Comment Your Code," I felt I had to weigh in on the subject myself as the devil's advocate.
WARNING: The following is a pure opinion piece, leave now if you are seeking technical information.
I recently finished reading Malcolm Gladwell's, The Tipping Point: How Little Things Can Make A Big Difference, and it really emphasized to me why posts about not commenting your code can be very dangerous. The majority of people are quite easily influenced. Most of the time, we are just subconsciously looking for an "excuse" to do something. To find these excuses, we often times look to icons and thought-leaders for the "go-ahead" to act a certain way. If you don't believe me, all you need to do is hear about Gladwell's example of the suicide rate in Micronesia - After a well known Micronesian "romantic" killed himself, the rate of suicide among teens in Micronesia exploded. And youths who had tried to kill themselves and failed, when asked why they had done it, replied that they had heard about it and wanted to "experiment" with suicide to see what it was like for themselves.
Now, I know what you're thinking - suicide and code commenting are hardly in the same ball park. But, that's exactly my point! If people can be so easily influenced by icons on subjects as extreme as suicide, how much more easily do you think it will be for them to be influenced by something as mundane as the practice of code commenting?
Brian points out that code should be self-documenting - that it should be written in such a way and with such clarity that just looking at it should reveal what it does. While I agree with the fact that code should be written this way, I think that having thought leaders in the ColdFusion world saying that clean code is enough might very well provide the tipping point of poor programming (making the big assumption that poor programming is not already rampant). It's one thing for a person, such as Brian, that writes very high quality code, to keep his comments to a minimum. But what about the majority of people who are not at his level? These are people who are not writing great code to begin with - are they going to view these blog posts as the excuse and justification to stop commenting their code? What happens then? We have an epidemic (as Gladwell would put it) of poorly written and poorly commented code.
Will this happen? I don't know. But, from what Malcolm Gladwell has taught me, little things can make a huge difference; the trends started by few can lead to epidemic behavior of the masses. As such, I think it is important that icons of the ColdFusion world do emphasize commenting as a best practice such that others will see it and follow suit.
I don't mean to single out Brian in any way; he's a great programmer and I hope to one day to have his handle on OOP and application architecture. His was merely the last blog post that I read on the subject. Brian also makes some very good points in his blog post and in the comments to his post. I am merely trying to play devil's advocate to keep things in perspective.