Regarding coding style

dave_mikesell at fastmail.fm dave_mikesell at fastmail.fm
Fri Mar 7 23:57:32 EST 2008


On Mar 7, 10:38 pm, Steven D'Aprano <st... at REMOVE-THIS-
cybersource.com.au> wrote:
> On Fri, 07 Mar 2008 20:04:47 -0800, dave_mikesell wrote:
> > On Mar 7, 10:31 am, "K Viltersten" <t... at viltersten.com> wrote:
> >> I've been recommended reading
> >> of:http://www.python.org/dev/peps/pep-0008/and in there i saw two
> >> things that i
> >> need to get elaborated.
>
> >> 1. When writing English, Strunk and
> >> White apply.
>
> > If your code needs so much descriptive prose that you have to consult
> > Strunk and White, refactor it to be more clear.   Excessive comments are
> > the hobgoblin of overly complex and/or sloppy code.
>
> Nonsense. Poor English is poor English whether you're writing short one-
> line comments or three hundred page manuals.
>
> store = make_store()
> x = get_stuff(store)  # Get the stuff what was brought at the store.

Perfect example of an unnecessary comment.  The variable and function
names are commentary enough.




More information about the Python-list mailing list