Style guide (was Re: [Python-Dev] req: Software Carpentry / coding standards)

Peter Funk
Wed, 7 Jun 2000 00:47:41 +0200 (MEST)


Greg Wilson:
> > > Tim Peters:
> > >
> > On Tue, 6 Jun 2000, Christopher Petrilli wrote:
> > The only thing that might be added (I haven't looked in a while, but
> > didn't see it last time I did), is some naming convention issues.  I
> > follow pretty standard Smalltalk guidelines:
> > 
> >        - No '_', use camelCase for seps
> I know this is become common practice, but I've been told by two different
> HCI specialists that studies have shown CamelBackNotation to be harder for
> non-native speakers to read than underbar_separated_text, particularly
> when acronyms are part of the name.  If anyone has a pointer to an
> original reference for this, I'd be grateful.

This would be indeed very interesting.  

But my own experiences support this POV:

This naming style issue is similar in Python and one of its early
anchestors Modula-2.

In 1985 we started our company programming in Modula-2.  At that
time we decided to code conforming to the original Modula-2 language
definition as published by N.Wirth in March, 1980:  underscores were 
not allowed in identifiers!  German: '_' verboten! ;-)

The software is in use until today and several of our employees still
have to use Modula-2 for maintainance.  The code base is currently
about 1 Mio. LOC.

We tried to use english identifiers, although all programmers are 
native german speakers.

We too adopted a style using first char lowercase or uppercase to
distinguish identifier classes (modules and procedure names uppercase
and all other identifiers lowercase) and later we ran into the
problems described above.

A few years ago we allowed the use of '_' in identifiers, because
the compiler support was available.  This has improved the situation
somewhat.  All our programmers like the possibility to occasionally
use '_' in identifiers, especially if idents contain acronyms.

Regards, Peter
Peter Funk, Oldenburger Str.86, D-27777 Ganderkesee, Germany, Fax:+49 4222950260
office: +49 421 20419-0 (ArtCom GmbH, Grazer Str.8, D-28359 Bremen)