Whitespace delimiters suck

Robert soundhack at hotmail.com
Thu Jan 20 23:28:05 EST 2000


Roy Smith wrote in message ...
>When I was first learning programming (a quarter of a century ago!),
>there was the idea of the "telephone test", i.e. your code should be
>simple enough that if you read it to somebody on the phone they would
>understand it.  Python not only fails the phone test, it fails the


If I understand you correctly, you mean python will fail it  because (for
example)
there are no end statements to if or for statements, and a line that should
be outside
the block might be interpreted by the listener to be inside. Putting aside
questions of
the usefulness/relevance of this test (I can not imagine why anyone would
want to read
source code over the phone in real life) I think python surpasses other
common languages
in this test by the fact that a  python program will be shorter and easier
to understand
than an equivalent C/++, Perl or Java program. I would rather read a few
lines of code in python,
 specifically denoting  to the listener where the blocks should be, than
read C code of an
equivalent program that is many times longer, or a Perl program with lots of
!@#$ punctuation
marks. (Case in point, when i was working with sockets what took me a
handful of python lines took
 about two pages of C code)

>printed page test; I can print two programs on a piece of paper, which
>differ only in tabs and spaces, and they will appear identical yet which
>do different things.  Barf.


I am not sure what you mean here. Yes, if you mix and match tabs and spaces
you will
experience this (and there are many things you can do to avoid this),
but if you have one program that has only tabs and one program that
has only spaces, they should not only look the same but run the same. I'm
not really a python or programming expert, tho, so you might be referring to
something else.

>I'm in love with python, but this idea of white space as significant
>syntax is the biggest wart on the language by far.

to me the biggest wart is speed, since I am usually too lazy to port
stuff from python to C to make things faster :)

Robert





More information about the Python-list mailing list