Most gratuitous comments

Marco Buttu marco.buttu at gmail.com
Tue Nov 25 07:40:08 EST 2014


On 21/11/2014 07:52, Marko Rauhamaa wrote:
> sohcahtoa82 at gmail.com:
>
>> >My point was that I was making fun of CS professors that demand a
>> >comment on every line of code, regardless of how clear the line of
>> >code is.
> Unfortunately, a lot of software houses do a similar thing. Not quite
> every line, but stuff like:
>
>     def write_line_to_file(file, line):
>         """Write a line to a file.
>
>            file is the file to add a line to
>            line is the line to add to the file"""
>         ...

To acknowledge the OP, the statistics module deserves to be taken as 
example for writing good comments and docstrings:

https://hg.python.org/cpython/file/3.4/Lib/statistics.py

-- 
Marco Buttu

INAF-Osservatorio Astronomico di Cagliari
Via della Scienza n. 5, 09047 Selargius (CA)
Phone: 070 711 80 217
Email: mbuttu at oa-cagliari.inaf.it




More information about the Python-list mailing list