tabs do WHAT?

Warren Postma wpostma at earthlink.net
Sun Jan 23 22:07:40 EST 2000


Let's see how many languages I have run into that make whitespace and/or
tabs important:

1. Makefiles: I once had a problem where a rule had a space where one was
not allowed, at the end of a line, causing me to spend three days finding
the problem.

2. Multi-line C Macros. Double Blech!  The '\' macro-continuation-character
must be the last character on the line.  Ever been hit with this one? Yuck.
At least you only do it once and then you learn.

3. Anything programmed on punch cards.  I seem to remember that the first 8
columns were used for line numbers (Fortran?)  and the middle bunch were for
code, and the last column was special somehow, and whitespace could
sometimes make or break your code.  Extra Yucky.

4. Python.

The two polar opposites (otherwise beautiful syntax, and the tabbed scoping)
are so fascinatingly horrible that you have to do a double- It's like the
commercial of the beautiful girl who's otherwise perfect smile is marred by
yellow nicotine stains. Sorry for the visual image, but hey, I gotta say, it
just doesn't fit with the rest of the language, and I don't buy it one bit.

A programmer/professor I once had for a software engineering course told us
about the "principle of least amazement": Anything weird or hard to explain
that you write into your software will later become the thing you regret.

As an embedded language, Python needs to be usable beyond the ivory towers
where functional programming or object oriented programming or metaclasses
are fodder for discussion.   Python looked eminently useable by
non-programmers until I found out that whitespace was meaningful.  Try to
explain scope to someone who doesn't write programs for a living.

Even BASIC, ugly as it is from a functionality point of view, is miles ahead
from the point of view of useability by people who are skilled technical
people, yet who are not "programmers".    Ergo, Visual Basic's popularity.
The language is a dog's breakfast, but at least the basic feature set you
use every day is clear and clean enough to keep in your head, and still have
room for your other domain-specific knowledge.

Python seems one of the few languages that is elegant enough for a computer
science type to appreciate, and yet not cluttered up with syntactic garbage
as to become an impenetrable mess (TCL, Perl, and the Granddaddy of
Unreadable Languages, )...   So close, and yet so far away. Has anyone built
a version of Python that totally ignores tabs and whitespace, or a filter
that you can use on top of Python? Perhaps  it could support both 'begin'
and 'end', or  '{' and '}' for scoping.  Heck, at least you could write it
in Python.  An interpreter within an interpreter. That would probably be
very slow, wouldn't it?

If Guido reads this, please note my personal feature request for Python 2.0:
Make the "whitespace" stuff optional, for people who like weird syntactical
features only. I'll love you forever. Thanks.

Warren Postma





More information about the Python-list mailing list