Re: Is PEP-8 a Code or More of a Guideline?
- From: Roy Smith <roy@xxxxxxxxx>
- Date: Mon, 28 May 2007 10:50:54 -0400
In article <KaedndQFOP7OucTbnZ2dnUVZ_hisnZ2d@xxxxxxxxxxx>,
Steven Bethard <steven.bethard@xxxxxxxxx> wrote:
Stefan Sonnenberg-Carstens wrote:
Paul McGuire schrieb:
I'm starting a new thread for this topic, so as not to hijack the one
started by Steve Howell's excellent post titled "ten small Python
programs".
In that thread, there was a suggestion that these examples should
conform to PEP-8's style recommendations, including use of
lower_case_with_underscores style for function names. I raised some
questions about this suggestion, since I liked the names the way they
were, but as a result, part of the discussion has drifted into a
separate track about PEP-8, and naming styles.
I prefer mixedCaseStyle, and I think that should be "standard", as this
style is commonly
used in all "major" languages , for example Java,C++,C#.
It shortens the identifiers but leaves the meaning intact.
The argument for under_score_names is usually that non-native speakers
can more easily find the word boundaries. Not being a non-native speaker
;-) I can't verify that one, but it's pretty plausible given the current
amount of money spent on research on automatic word-segmentation for
languages like Chinese. =)
STeVe
I've gone through a few different flavors of composite name schemes over
the years (starting with FORTRAN's 6 upper case character limit). When
first exposed to camelCase, I thought it was horrible. Eventually, I came
to like it.
On the other hand, I'm convinced that words_with_underscores, is easier to
read. This is especially true when abbreviations creep into variable
names. It's certainly easier to parse ip_address as compared to IPAddress.
Same with snmp_manager vs SNMPManager.
I really like lisp's convention of using dashes instead of underscores,
i.e. ip-address and snmp-manager. I think the only reason most languages
don't use that is the parsing ambiguity, but if you required white space
around all operators, then "ip-address" would unambiguously be a variable
name and "ip - address" would be a subtraction expression.
.
- Follow-Ups:
- Re: Is PEP-8 a Code or More of a Guideline?
- From: Frank Swarbrick
- Re: Is PEP-8 a Code or More of a Guideline?
- From: Sergei Organov
- Re: Is PEP-8 a Code or More of a Guideline?
- From: Steve Howell
- Re: Is PEP-8 a Code or More of a Guideline?
- References:
- Is PEP-8 a Code or More of a Guideline?
- From: Paul McGuire
- Re: Is PEP-8 a Code or More of a Guideline?
- From: Stefan Sonnenberg-Carstens
- Re: Is PEP-8 a Code or More of a Guideline?
- From: Steven Bethard
- Is PEP-8 a Code or More of a Guideline?
- Prev by Date: Re: Can string be callable as a method ?
- Next by Date: gettext backwards
- Previous by thread: Re: Is PEP-8 a Code or More of a Guideline?
- Next by thread: Re: Is PEP-8 a Code or More of a Guideline?
- Index(es):
Relevant Pages
|