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

Neil Cerutti horpner at yahoo.com
Sat Jun 16 16:56:03 CEST 2007


On 2007-06-16, Steven D'Aprano <steve at REMOVE.THIS.cybersource.com.au> wrote:
> 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.

We do sometimes have to use a while loop in Python where we could
use a for loop in some other language. It's not really a big
deal.

> 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.

It's making me think of the male model in Zoolander who can't
turn left. ;)

>> 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?

I vote for C++ as being astoundingly complex. But it provides
complex features, e.g.,the machanisms it provides to deal with
multiple inheritance, or generic, type-safe code. I don't think
it's inconsistent, though. The complexity of a feature *tends* to
mirror the *real* complexity.

-- 
Neil Cerutti



More information about the Python-list mailing list