Comments on Comments
Exploring the benefits of better commenting
Issue: 7.2 (January/February 2009)
Author: Marc Zeedar editor-at-rbdeveloper.com
Article Description: No description available.
Article Length (in bytes): 24,502
Starting Page Number: 18
RBD Number: 7209
Resource File(s): None
Related Link(s): None
Known Limitations: None
Excerpt of article text...
One of my first puzzlements when learning to program in BASIC a couple decades ago was the bizarrely-named REM command. REM apparently allowed you to add a "remark" about the code -- any text following the word REM was ignored when the code was executed. This seemed useless to me except for vanity: almost all BASIC programs back in those days began with a few comments that listed the name of the program, the author, and the copyright. Other than that, what good were comments?
I've come a long way since those heady days, but I still struggle with comments. Comments are like flossing -- a healthy habit most people don't do often enough.
We all know that comments can be helpful. If you've ever seen a well-commented program you know that the comments help make what's going on more clear. If you've ever looked at non-commented code -- even of one of your own projects -- and been bewildered, you know the pain of not having good comments.
But if we know the benefits of comments, why don't programmers comment more?
...End of Excerpt. Please purchase the magazine to read the full article.
Article copyrighted by REALbasic Developer magazine. All rights reserved.