Default indentation of 4 columns

François Pinard pinard at iro.umontreal.ca
Mon Nov 1 19:48:33 EST 1999


Gareth McCaughan <Gareth.McCaughan at pobox.com> écrit:

> François Pinard wrote:

> > The only thing that really rebukes me is the interdiction to use
> > capitals in comments to mark non-terminals (or variables), as it does
> > not get accompanied by a better suggestion, or at least, none yielding
> > as much clarity.

> You mean saying things like

>     # Return the sum of AARDVARK and ARMADILLO.
>     def f(aardvark, armadillo):
>         return aardvark+armadillo

> I use a convention derived from Knuth's literate programming
> systems, and write

>     # Return the sum of |aardvark| and |armadillo|.

It is a good idea.  Yet, maybe because I've been so exposed to GNU software,
I'm quite used to the capitals convention, and find it very legible.
I would have tendency to stick to something in (relatively) wide use, than
to run away from the dilemma and hide into something less well known :-).

> ? (Incidentally, this example is another one that shows an
> annoying "accidental alignment" as a result of the four-character
> rule.

Usually, the `def' is outstanding enough already, preceded by a blank line,
being left aligned, and especially highlighted in some good editors (:-),
that I would not think the above really creates a real practical problem.

-- 
François Pinard   http://www.iro.umontreal.ca/~pinard






More information about the Python-list mailing list