[Tutor] How to refactor a simple, straightforward script into a "proper" program?

Alan Gauld alan.gauld at yahoo.co.uk
Sun Jan 5 19:29:21 EST 2020


On 05/01/2020 02:06, DL Neil via Tutor wrote:

> One of my favorite comments about comments (and docstrings) was 
> "mumbling". My recollection is that this was describing comments that 
> were either of no real use, eg "# adding a to b"; or were purely there 
> in order to satisfy 'requirements' - I've been known to persuade a 
> linter to shut-up by writing ''' Docstring. ''' (don't forget the u/case 
> nor the final punctuation!) BTW I think I'm fooling the linter, but I'm 
> really only fooling myself...

I once worked on a large (very large - 10,000+ files) C project.
It was initially written by a US tech company and sent to us.
They in turn had employed many short term contractors to meet
the project deadline...
When we reviewed the code we found lots of files with things
like this at the top:

/* Scooby dooby dooo.....

<insert 50 blank lines...>

Where are you.... */

Or

/* I need comments to pass the metrics program....


<followed by the lyrics of a popular song.>

My favourite was "I did it my way..."
but another apropos title was the chorus of
"The Marvellous Toy"  :-)

-- 
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



More information about the Tutor mailing list