The worth of comments

Alister Ware alister.ware at ntlworld.com
Sun May 29 13:26:16 EDT 2011


On Sun, 29 May 2011 12:47:52 +1200, Gregory Ewing wrote:

> Irmen de Jong wrote:
> 
>> I don't see how that is opposed to what Grant was saying. It's that
>> these 'contracts' tend to change and that people forget or are too lazy
>> to update the comments to reflect those changes.
> 
> However, I can't see that deleting the comment documenting the contract
> can be the right response to the situation.
> 
> If the contract comment doesn't match what code does, then there are two
> possibilities -- the comment is wrong, or the code is wrong. The
> appropriate response is to find out which one is wrong and fix it.
> 
> If you simply delete the comment, then you're left with no redundancy to
> catch the fact that something is wrong.

"if the comments & code disagree then both are probably wrong"



-- 
Most public domain software is free, at least at first glance.



More information about the Python-list mailing list