Newsgroups: comp.lang.python
From: Paul McGuire <pt...@austin.rr.com>
Date: 26 May 2007 18:23:39 -0700
Local: Sun, May 27 2007 11:23 am
Subject: Re: ten small Python programs
I ***love*** this "10 Little Programs" idea! As soon as I get a
breathing space, I'm going to add a "10 Little Parsers" page to the pyparsing wiki! On May 26, 2:38 pm, Steven Bethard <steven.beth...@gmail.com> wrote: > <nitpick> Really? Underscore-separated words preferred over camel case? What > Though the code should probably follow PEP 8 guidelines, e.g. > under_scores instead of camelCase for object and method names: > http://www.python.org/dev/peps/pep-0008/ is the rationale for this? This style is so retro/80's/C-ish. It seems more like a Java backlash to me than anything else. If we (or Guido) don't like changing case to indicate word breaks, why are class names to be UpperCamelCase, and not Capitalized_with_underscores? If there is a casing convention nit to pick, I'd focus on UpperCamelCase for class names, lower case (either with underscores or mixed case) for attributes and method names, and UNDERSCORE_SEPARATED_ALL_CAPS for constants. If we want to just say "well, PEP-8 says such and such," I think this > > class ShoppingCart: the body on the same line as the def statement. How's this for a better non-trivial method example: MAX_ITEMS_FOR_EXPRESS_LANE = 10 or call it "can_use_express_lane" if you must. I guess pyparsing with its mixedCase functions and attributes is -- Paul You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||