Re: Most gratuitous comments

2014-12-04 Thread Rob Gaddi
On 04 Dec 2014 09:48:49 GMT alb...@spenarnc.xs4all.nl (Albert van der Horst) wrote: > In article <546d7505$0$12899$c3e8da3$54964...@news.astraweb.com>, > Steven D'Aprano wrote: > >And the award for the most gratuitous comments before an import goes to > >one of my (former) workmates, who wrote t

Re: Most gratuitous comments

2014-12-04 Thread sjmsoft
Many years ago I, too, had a couple of CS profs who forced us to include too many (usually innocuous) comments in our Fortran and PL/1 code. Perhaps they were trying to counter the natural programmer tendency of not commenting at all? Forty years of programming later (yikes!), I try to use comm

Re: Most gratuitous comments

2014-12-04 Thread Jean-Michel Pichavant
- Original Message - > From: sohcahto...@gmail.com > I was trying to illustrate the point that some professors would > demand you write code like this... > > # increment the line count > lineCount += 1 > > # Check if line count is over 10 > if lineCount > 10 > # Tell the user there ar

Re: Most gratuitous comments

2014-12-04 Thread Albert van der Horst
In article <546d7505$0$12899$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: >And the award for the most gratuitous comments before an import goes to >one of my (former) workmates, who wrote this piece of code: > ># Used for base64-decoding. >import base64 ># Used for ungzipping. >imp

Re: Most gratuitous comments

2014-11-25 Thread Steven D'Aprano
Marko Rauhamaa wrote: > Marco Buttu : > >> 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 > > True, it is done with good style. It concentrates on documenting

Re: Most gratuitous comments

2014-11-25 Thread Marko Rauhamaa
Marco Buttu : > 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 True, it is done with good style. It concentrates on documenting use and lets the implementation do

Re: Most gratuitous comments

2014-11-25 Thread Marco Buttu
On 21/11/2014 07:52, Marko Rauhamaa wrote: sohcahto...@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, b

Re: Most gratuitous comments

2014-11-21 Thread Grant Edwards
On 2014-11-21, Marko Rauhamaa wrote: > sohcahto...@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 l

Re: Most gratuitous comments

2014-11-20 Thread Marko Rauhamaa
sohcahto...@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(f

Re: Most gratuitous comments

2014-11-20 Thread Chris Angelico
On Fri, Nov 21, 2014 at 11:19 AM, wrote: > On Thursday, November 20, 2014 4:17:33 PM UTC-8, Chris Angelico wrote: >> It's about giving people proper credit for what they said. > > Fair enough. Thank you. That's a nice, tidy attribution line, and it's clear who said what. Including both name and

Re: Most gratuitous comments

2014-11-20 Thread sohcahtoa82
On Thursday, November 20, 2014 4:17:33 PM UTC-8, Chris Angelico wrote: > On Fri, Nov 21, 2014 at 10:59 AM, wrote: > >> (By the way, whatever tool you are using to post comments is badly breaking > >> attributions. It is polite to give the person's full name when quoting > >> them, when they provi

Re: Most gratuitous comments

2014-11-20 Thread Chris Angelico
On Fri, Nov 21, 2014 at 10:59 AM, wrote: >> (By the way, whatever tool you are using to post comments is badly breaking >> attributions. It is polite to give the person's full name when quoting >> them, when they provide one, if not give their full email address. >> Truncating their email address

Re: Most gratuitous comments

2014-11-20 Thread sohcahtoa82
On Thursday, November 20, 2014 3:16:33 PM UTC-8, Steven D'Aprano wrote: > sohcahto...@gmail.com wrote: > > > On Thursday, November 20, 2014 1:33:16 PM UTC-8, c...@isbd.net wrote: > >> s...@gmail.com wrote: > >> > > >> > # increment x > >> > x += 1 > >> > >> But it shouldn't say 'increment x', it

Re: Most gratuitous comments

2014-11-20 Thread Mark Lawrence
On 20/11/2014 21:32, c...@isbd.net wrote: sohcahto...@gmail.com wrote: # increment x x += 1 But it shouldn't say 'increment x', it should say 'add one to the line count' or some such. Although changing the variable name to 'lineCount' would do almost as well. Would you please clarify whet

Re: Most gratuitous comments

2014-11-20 Thread Steven D'Aprano
sohcahto...@gmail.com wrote: > On Thursday, November 20, 2014 1:33:16 PM UTC-8, c...@isbd.net wrote: >> s...@gmail.com wrote: >> > >> > # increment x >> > x += 1 >> >> But it shouldn't say 'increment x', it should say 'add one to the line >> count' or some such. Although changing the variable n

Re: Most gratuitous comments

2014-11-20 Thread sohcahtoa82
On Thursday, November 20, 2014 1:33:16 PM UTC-8, c...@isbd.net wrote: > s...@gmail.com wrote: > > > > # increment x > > x += 1 > > But it shouldn't say 'increment x', it should say 'add one to the line > count' or some such. Although changing the variable name to > 'lineCount' would do almost as

Re: Most gratuitous comments

2014-11-20 Thread cl
sohcahto...@gmail.com wrote: > > # increment x > x += 1 But it shouldn't say 'increment x', it should say 'add one to the line count' or some such. Although changing the variable name to 'lineCount' would do almost as well. -- Chris Green ยท -- https://mail.python.org/mailman/listinfo/python-l

Re: Most gratuitous comments

2014-11-20 Thread Stefan Behnel
Chris Angelico schrieb am 20.11.2014 um 06:06: > On Thu, Nov 20, 2014 at 3:58 PM, Steven D'Aprano wrote: >> And the award for the most gratuitous comments before an import goes to >> one of my (former) workmates, who wrote this piece of code: >> >> # Used for base64-decoding. >> import base64 >> #

Re: Most gratuitous comments

2014-11-20 Thread sohcahtoa82
On Wednesday, November 19, 2014 8:59:01 PM UTC-8, Steven D'Aprano wrote: > And the award for the most gratuitous comments before an import goes to > one of my (former) workmates, who wrote this piece of code: > > # Used for base64-decoding. > import base64 > # Used for ungzipping. > import gzip >

Re: Most gratuitous comments

2014-11-20 Thread Mark Lawrence
On 20/11/2014 04:58, Steven D'Aprano wrote: And the award for the most gratuitous comments before an import goes to one of my (former) workmates, who wrote this piece of code: # Used for base64-decoding. import base64 # Used for ungzipping. import gzip I wonder if anybody has ever written thi

Re: Most gratuitous comments

2014-11-19 Thread Chris Angelico
On Thu, Nov 20, 2014 at 3:58 PM, Steven D'Aprano wrote: > And the award for the most gratuitous comments before an import goes to > one of my (former) workmates, who wrote this piece of code: > > # Used for base64-decoding. > import base64 > # Used for ungzipping. > import gzip Well hey. Good to