| Store | Cart

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

From: Tim Peters <tim....@comcast.net>
Fri, 12 Jul 2002 04:22:31 -0400
[Miki Tebeka]
> Although it's in the Humor section I take the Python Zen> (http://www.python.org/doc/Humor.html#zen) quite seriously.>> However I can understand what does “Sparse is better than> dense” means.>> Any Ideas (Tim?)

The value of an aphorism is in provoking you to ponder.  So long as you
suspect there's something of value in it that you don't yet understand, it's
doing its job.  As soon as someone thinks they understand it, and then just
repeats it (whether to endorse or ridicule doesn't much matter) in lieu of
contemplation, its usefulness is exhausted.  I suspect that's why God always
arranges to get himself killed whenever he takes on human form <wink>.

I've read that if you confine too many rats in too small a living space,
they become sociopathic.  That's density for you.  I've seen no reason to
suspect that code, concepts, data structures, interfaces, programmers or
managers have an advantage over rats in this respect.  Give yourself some
room to breathe and stretch:  couple interfaces loosely, let a subsystem
deal with a little rather than a lot, leave a little whitespace for flowers
to grow between tokens, fail soft on feathers instead of hard on rocks,
don't do two things at a time until you're pretty sure you can do one, a
function with 14 arguments-- or a module with 14 classes --is a bad idea,
don't fall for the idea that between any two abstractions you always need to
compromise on a third.  Etc.

In other words, sparse is better than dense.  Except when it comes to chip
design, where sparseness plain sucks <wink>.

pythons-swallow-rats-one-at-a-time-ly y'rs  - tim

Recent Messages in this Thread
Miki Tebeka Jul 11, 2002 11:28 am
Peter Hansen Jul 11, 2002 12:24 pm
Mark McEahern Jul 11, 2002 01:07 pm
Aahz Jul 11, 2002 06:35 pm
Mike C. Fletcher Jul 11, 2002 08:23 pm
Andrae Muys Jul 11, 2002 11:30 pm
jep...@unpythonic.net Jul 11, 2002 11:45 pm
Peter Hansen Jul 12, 2002 03:31 am
Ian Bicking Jul 12, 2002 08:00 am
Tim Peters Jul 12, 2002 08:22 am
Bernhard Herzog Jul 12, 2002 07:09 pm
Peter Hansen Jul 12, 2002 08:27 am
Messages in this thread