The worth of comments

Grant Edwards invalid at invalid.invalid
Fri May 27 13:53:15 EDT 2011


On 2011-05-27, Irmen de Jong <irmen at -NOSPAM-xs4all.nl> wrote:
> On 27-05-11 15:54, Grant Edwards wrote:
>> On 2011-05-27, Ben Finney<ben+python at benfinney.id.au>  wrote:
>>> Richard Parker<r.richardparker at comcast.net>  writes:
>>>
>>>> On May 26, 2011, at 4:28 AM, python-list-request at python.org wrote:
>>>>
>>>>> My experience is that comments in Python are of relatively low
>>>>> usefulness. (For avoidance of doubt: not *zero* usefulness, merely
>>>>> low.)
>>
>> I've seen plenty of comments who's usefulness was not zero.  It was
>> less than zero.
>
> Someone once taught me, "There is one thing worse than having no 
> comments in the source code: having incorrect (or 'lying') comments
> in the code."
>
> Grant, I guess you hint at such comments?

Yes.  :)

When trying to find a bug in code written by sombody else, I often
first go through and delete all of the comments so as not to be
mislead.

The comments reflect what the author _thought_ the code did
_at_some_point_in_the_past_.  What matters is what the code actually
does at the present.

-- 
Grant Edwards               grant.b.edwards        Yow! ... If I had heart
                                  at               failure right now,
                              gmail.com            I couldn't be a more
                                                   fortunate man!!



More information about the Python-list mailing list