Via LtU, JavaZone: Why I Don't Read Code Comments, by Dr. Heinz Kabutz. "I don't like comments. They are often so useless that I usually don't read them. Ever since my older brother caught me typing REM statements into a program as a child and then broke the news to me that they did absolutely nothing, I've developed a keen distrust of comments. This opinion only solidified when I pursued my computer science degree. I realized that my classmates and I wrote comments only to earn good marks from mean-spirited instructors who were more concerned with whether our code was commented than whether it worked correctly! Simply put, I felt that comments were a waste of time."
Funny and short article. Obviously we need comments, but the most useful thing he has to tell you is to make your code more descriptive. For instance, if the paramater to getName() was "component_index" instead of "idx", it might have been a little clearer. It was already pretty clear, but that's just an example. Always use long names where it makes sense, and feel free to use underscores_in_your_variable_names. LtU also has a good discussion on comments worth checking out.
Feel free to post a comment below. Please see my comment policy.
Formatting Rules (No HTML):