Whitespace as syntax (was Re: Python Rocks!)

Tim Peters tim_one at email.msn.com
Tue Feb 8 08:15:18 CET 2000

[posted & mailed]

[fcahoon at my-deja.com]
> ...
> If python code were to become mis-formatted (and given my experience,
> I have to believe that sooner or later this _will_ happen) there is
> _no way_ to be certain what the original author's intent was, much
> less to fix it automatically.  This is a Bad Thing(tm).

If you want to use block delimeters, the std distribution's
Tools/Scripts/pindent.py supports them in the form of comments (& can
reconstruct the intent after this mysterious <0.1 wink> misformatting plague
strikes).  I've never seen Python code that bothers with this (except for
pindent.py itself!), as worrying about massive accidental misformatting is
about as productive as worrying about random lines vanishing from the middle
of C files (from which you could also not recover intent).  Such things are
possible, albeit unlikely.  But a serious project uses some form of source
control in any case, and doesn't *let* massive changes accumulate without
two layers of checkpointed backup.

Not everyone likes Python's use of indentation, of course.  Most Python
users like it a whole lot.  To the language's designer, it's a key part of
the design (WYSIWYG, guaranteed, reliably and consistently across
programmers), so it's not going to change.

In Python practice (& I've been using Python longer than Guido <wink>), I
find it takes no more care than I take to make my C++ code readable, and
actually less so (less noise to type).  I don't use tab characters,
though -- but *any* successful multi-programmer project needs mandatory
coding stds.  They happen to be simpler in Python, because there's less junk
in need of arbitrary rules.

A lot of people are telling you your concerns are unfounded, but arguing
about this is useless.  Try it!  See what it's actually like.

i-was-40-before-i-tried-asparagus<wink>-ly y'rs  - tim

More information about the Python-list mailing list