Flat-schmat!

A.M. Kuchling amk at amk.ca
Sun Oct 5 10:32:52 EDT 2003


On Sun, 05 Oct 2003 12:27:47 GMT, 
	Kenny Tilton <ktilton at nyc.rr.com> wrote:
> Python (I gather from what I read here) /deliberately/ interferes in my 
> attempts to conform my code to the problem at hand, because the 
> designers have decreed "flat is better". Python rips a tool from my 
> hands without asking if, in some cases (I would say most) it might be 
> the right tool (where an algorithm has a tree-like structure).

Oh, for Pete's sake... Python is perfectly capable of manipulating tree
structures, and claiming it "rips a tool from my hand" is simply silly.

The 19 rules are general principles that encapsulate various principles of
Python's design, but they're not hard-and-fast rules to be obeyed like a
legal code, and their meanings are unspecified.  I have seen the "flat is
better than nested" rule cited against creating too many submodules in a
package, against nesting loops too deeply, against making code too dense.
You can project any meaning onto them you wish, much like Perlis's epigrams
or Zen koans.

--amk




More information about the Python-list mailing list