do people really complain about significant whitespace?

Ben Finney bignose+hates-spam at benfinney.id.au
Mon Aug 7 19:49:01 EDT 2006


"infidel" <saint.infidel at gmail.com> writes:

> It just sounds like so much trivial nitpickery that it's hard to
> believe it's as common as we've come to believe.

As others have pointed out, these people really do exist, and they
each believe their preconception -- that significant whitespace is
intrinsically wrong -- is valid, and automatically makes Python a
lesser language.

One of the most stupid language-definition decisions that most people
have come across is the Makefile format. If you're not familiar with
it, spaces and tabs are *each* significant. Specifically, putting
spaces where a tab is required will result in a file that, while it
may be visually identical to a correctly formatted file, doesn't parse
correctly. In hindsight it's trivial to predict the needlessly painful
learning process that ensues.

This is a very painful memory for many programmers, and the general
opinion that results is "syntactically significant whitespace is
bad". This is the phrase that always gets brought out, and it's often
clear that the person hasn't considered *why* it's bad.

The issue with the Makefile format (lampooned wonderfully by the
Whitespace programming language) is that *invisible* differences in
whitespace should not be significant. In a Makefile, you *must* mix
spaces and tabs in the same file; this leaves the door wide open to
invisible differences. In Python, an admonishment of "always indent
each file consistently" suffices.

Hope that goes some way to explaining one possible reason why rational
people can consistently react in horror to the issue.

-- 
 \          "Friendship is born at that moment when one person says to |
  `\      another, 'What! You too? I thought I was the only one!'"  -- |
_o__)                                                       C.S. Lewis |
Ben Finney




More information about the Python-list mailing list