The worth of comments
- From: Richard Parker <r.richardparker@xxxxxxxxxxx>
- Date: Thu, 26 May 2011 11:50:25 -0700
On May 26, 2011, at 4:28 AM, python-list-request@xxxxxxxxxx wrote:
My experience is that comments in Python are of relatively low
usefulness. (For avoidance of doubt: not *zero* usefulness, merely low.)
I can name variables, functions and classes with sensible, self-
documenting names. Why write:
x = get_results(arg) # x is a list of 1 or more results
[... much later]
for y in x:
# process each result in turn
do_something_with(y)
(It occurred to me that I should use a specific subject for this discussion.)
I'm less inclined to use comments on each line, or selected lines, but rather use block comments instead. They require more thought and time to write; however, the intended functionality of the code that follows can be described in full.
.
- Follow-Ups:
- Re: The worth of comments
- From: Miki Tebeka
- Re: The worth of comments
- From: Miki Tebeka
- Re: The worth of comments
- From: Roy Smith
- Re: The worth of comments
- From: Ben Finney
- Re: The worth of comments
- Prev by Date: Re: Puzzled by list-appending behavior
- Next by Date: Re: Python's super() considered super!
- Previous by thread: Python's super() considered super!
- Next by thread: Re: The worth of comments
- Index(es):
Relevant Pages
|