Re: Is PEP-8 a Code or More of a Guideline?



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.
.



Relevant Pages

  • Re: Selecting an Architecture to Instantiate
    ... The problem with Charles' suggestion was that I didn't understand it - I ... first saw VHDL about two weeks ago and this middle aged dog is beginning to ... It'll only resemble software if you're used to writing parallel ... simply don't exist in the languages taught today. ...
    (comp.lang.vhdl)
  • Re: threading and multicore on the "free" lisps -- any unified interface similar to CFFI for
    ... minutes after you wrote that suggestion you told us things in a ... languages have problems, or that Clojures design might not be as good ... these mainstream languages are good for all tasks under all ... In my prior work with interactive parallel language constructs (R's ...
    (comp.lang.lisp)
  • Re: String... next logical step?
    ... I simply submitted a suggestion for Jacob's ... consideration, and you respond and essentially, tell me it's a stupid idea! ... This is just a short list of languages that use the syntax I propose. ... Fortunatly Jacob thinks also that using + for Stringcatenation is a ...
    (comp.compilers.lcc)
  • Re: Using non-ascii symbols
    ... > How do people on this group feel about this suggestion? ... > Are there similar attempts in other languages? ... Or "w" meaning "omega. ... Right now, English is accepted as ...
    (comp.lang.python)
  • Toggling Spelling Dicitionary while Inside a Document
    ... I conduct business in two languages, ... This post is a suggestion for Microsoft, ... Agree" button in the message pane. ...
    (microsoft.public.office.misc)