Whitespace delimiters suck

Gordon McMillan gmcm at hypernet.com
Fri Jan 21 08:49:06 EST 2000


Roy Smith wrote:

> 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,

Do the same thing that the parser (or tokenizer) does: say 
"INDENT" and "DEDENT". Or run it through pyindent and read 
that over the phone.

> it fails the 
> 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.

While theoretically possible, I have never seen whitespace 
confusion induced by different editor settings create a 
syntactically valid program.

And there's tabnanny and tabcleaner if this is a common 
problem for you.

- Gordon




More information about the Python-list mailing list