| Store | Cart

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

From: jepler@unpythonic.net <jep...@unpythonic.net>
Thu, 11 Jul 2002 18:45:24 -0500
On Thu, Jul 11, 2002 at 04:30:59PM -0700, Andrae Muys wrote:
> aahz at pythoncraft.com (Aahz) wrote in message news:<agkj5s$gka$1 at panix1.panix.com>...> > In article <33803989.0207110328.5ef01f1e at posting.google.com>,> > Miki Tebeka <tebeka at cs.bgu.ac.il> wrote:> > >> > >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.> > > > To rephrase the dictum another way, "Don't try to stick too much code on> > one line."> > Well seeing as we are discussing Python Zen, the one I don't currently> understand is "Flat is better than Nested".  I had always thought the

Nested is
    A
	B
	    C
		D

flat is
    A
	B
	C
	D

Python has lots of namespaces, but they're relatively flat.  Usually,
module->class->function or module->function, but with nested_scopes
sometimes an additional level of function is seen.

That's my take on it ...

Jeff

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

Previous post: pygame question