What I have seen is that this style of comment (in particular) tends to grow less accurate as it passes through iterations of maintenance. Eventually it becomes just wrong, for example referring to parameters that are no longer used, or describing the original purpose that no longer applies.
And if you don't trust the comment, you have to read the code, and if you end up reading the code then why bother with this type of comment in the first place.
It could also be argued that this style of comment is a form of code duplication, complete with the same maintenance issues. Of course I want to see helpful comments, particularly for dense or terse code, but frankly I've developed a form of comment-blindness, triggered by code like this:
/**********************************************
* Copyright: Moneygrubbers, inc 1982-1984 *
* ALL RIGHTS RESERVED *
* System: Custom IEBGENER for CICS T1 *
* Name: MyFunction *
* Created: 1 Jan 1982 *
* Author: asmith *
* Purpose: Apply foo algorithm to bar data *
* Returns: bptr - ptr to modified bah *
* Mod: asmith *
* Mod Purpose: bar is now baz *
* Mod Date: 2 Jan 1982 *
* Parameters: bar - ptr to bar *
* Parameters: baz - stack copy of bar *
* Known bugs: none *
* Other comments: Hello, World! *
* Re-written by bjones 1998 *
* Code Status: UNREVIEWED *
*********************************************/
(Exaggerated for dramatic effect)
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|