On 18/12/2025 14:40, Peter Flass wrote:

> ...I've almost never looked at a program and 
> said "I wish it had fewer comments."

Sadly I have. In one notable example we sub-contracted
the coding out to an external company and the contract
specified some code "quality metrics" one of these was
the ratio of comments to code.

I  then had the dubious privilege of trying to debug
files with the entire lyrics of "I Did it My Way" in
the header comments. And another that contained lines
like the following:

if incrementNodeValues(theNodes) == None:
   # Scotty: Captain the node value incrementer just failed
   # Kirk:  Can you manually over ride it Mr Scott?
   # Scotty: I cannae override maxint captain!
   raise NodeOverFlowError

Others were more blatant(and honest!):

def someFunc():
    # some pointless comments to meet the metrics
    # dum
    # de
    # dum
    ... etc

I love good comments but comments for the sake of
it not so much!

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


-- 
https://mail.python.org/mailman3//lists/python-list.python.org

Reply via email to