The worth of comments

Irmen de Jong irmen.NOSPAM at xs4all.nl
Sat May 28 09:09:52 EDT 2011


On 27-5-2011 19:53, Grant Edwards wrote:
> 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.
> 

I'm going to share this thread, and the funny slideshow about Uncomment your code, with
my team at work :-)
We're not a Python shop so I'm probably the only one reading this, but as usual there is
a lot of wisdom going on in this newgroup that is not only applicable to Python.

Irmen



More information about the Python-list mailing list