Python's "only one way to do it" philosophy isn't good?

Steven D'Aprano steve at REMOVE.THIS.cybersource.com.au
Sat Jun 16 14:44:47 CEST 2007


On Fri, 15 Jun 2007 22:25:38 -0700, Alex Martelli wrote:

> The "Spirit of C" section in the preface of the ISO Standard for C
> phrases this principle as "Provide only one way to do an operation".

Taken seriously, that rapidly goes to absurdity -- it would mean, for
example, replacing all for loops with while loops.

That's why I get mad at people who misquote (and often misunderstand) the
Zen of Python's OOWTDI, misquoting it as Only One Way To Do It instead of
One Obvious Way To Do It. There can be a hundred unobvious ways to do it,
and it doesn't matter, so long as there is one obvious way.

Needlessly restricting what a language includes leads to a language that
does things badly. After all, all you really need is a virtual Turing
Machine, and you can do anything Python or Lisp or Perl or C can do. Badly.

I'm probably preaching to the converted, because I'm pretty sure Alex
doesn't believe Python should be a minimalist language with _literally_
only one way to do anything.


> Despite the phrasing variations, this commonality goes well with my
> perception that, at their roots, Scheme, C and Python share one
> philosophical underpinning (one that's extremely rare among programming
> languages as a whole) -- an appreciation of SIMPLICITY AND UNIFORMITY as
> language characteristics.

Out of curiosity, what do you consider some of the worst offenders as far
as overly complex and inconsistent languages go, and why?




-- 
Steven.




More information about the Python-list mailing list