Zen of Python

Jeff Shannon jeff at ccvcorp.com
Thu Jan 20 02:55:30 CET 2005

Timothy Fitz wrote:

> On 19 Jan 2005 15:24:10 -0800, Carl Banks <invalidemail at aerojockey.com> wrote:
>>The gist of "Flat is better than nested" is "be as nested as you have
>>to be, no more," because being too nested is just a mess.
> Which I agree with, and which makes sense. However your "gist" is a
> different meaning. It's not that "Flat is better than nested" it's
> that "Too flat is bad and too flat is nested so be as nested (or as
> flat) as you have to be and no more." Perhaps Tim Peters is far too
> concise for my feeble mind <wink>

Well, the way that the Zen is phrased, it implies a bit more than 
that.  We all agree that there's a balance to be found between 
"completely flat" and "extremely nested"; the specific phrasing of the 
Zen conveys that (in the Python philosophy at least) the appropriate 
balance point is much closer to the "completely flat" side of things. 
    It's not "... as nested (or as flat) as you have to be and no 
more", it's "... as nested as you have to be and no more, but if you 
need significant nesting, you might want to re-examine your design".  ;)

Jeff Shannon
Credit International

More information about the Python-list mailing list