Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror

Comment Use a simple source code documentation covention (Score 1) 203

Commenting Code

Effective and practical documentation captures the intended use of modules, classes and routines in a user-manual-like form. In order to produce highly maintainable documentation, practice indicates that comments should not focus on explaining how the code works, but rather on how the code is to be used.

If comments are used to explain how the code works, any alteration to the code will render the documentation obsolete, resulting in duplication of effort and inaccurate documentation.

Plain English at the top of the file and each code construct should be used to describe its unique purpose and objective. Inline, detailed comments should be avoided because they cannot express the mechanics of the code more accurately than the code itself.

By avoiding the description of "anything between the brackets", the formal documentation reaches the non-redundant level of abstraction needed to streamline the authorship, usage and maintenance of the code.

http://www.ptlogica.com/TwinText/paper.htm

Slashdot Top Deals

The Shuttle is now going five times the sound of speed. -- Dan Rather, first landing of Columbia

Working...