What does "Sparse is better than dense" mean? (Python Zen)

Donn Cave donn at drizzle.com
Sat Jul 13 03:26:28 EDT 2002


Quoth "James J. Besemer" <jb at cascade-sys.com>:
...
"...to the letter."  This strikes me as a "foolish consistency."

| I think the standard is good overall but what makes it best is it
| acknowledges up front that there's some room for personal judgment
| and common sense.  Among adults I expect we all can accommodate a
| little flexibility in following these rules.  So to some extent, I
| regard interpreting it "to the letter" to be inconsistent with how
| the PEP is written.

I don't propose to take any action against people who deviate from it,
and in fact I probably do so myself.  But the problem with that is
that everyone has an opinion, and it's always good judgement and common
sense, to the one who holds it.

We can say "follow the standard", or we can say "follow the standard
unless you have some other idea."  If you have a good way for people
to tell the difference between their own personal idiosyncrasies and
a really good idea that really deserves to be an exception, that
would be interesting.

| My particular problem is that some of the express rules about horizontal
| white space actually hinder readability.  As Mr. Corns points out,
...
| But from a readability standpoint, it is a superior (and harmless) deviation
| from the standard.

This is really my point.  There are two ways of looking at it.  If you
evaluate the standard from first principles, you can certainly argue that
there may be superior alternatives.  But a standard style actually creates
its own advantage, assuming that it's widely used.  Once a coding style has
really become standard, deviations from it will tend to be less readable
for most of the people who are used to that standard, and it makes no
difference if the deviations are in principle superior.  Looking at it
that way, there really is no such thing as a superior deviation from the
standard, it's a contradiction in terms.

I'm accommodating a little flexibility, just don't try to tell me the
the result will be more readable.  It won't be.

	Donn Cave, donn at drizzle.com

By the way, speaking of style - you may not have noticed that you
formatted your post to 84 columns.  75 or less would be nice.  I
reformatted for you.



More information about the Python-list mailing list