Dijkstra on Python

Skip Montanaro skip at pobox.com
Thu Aug 15 09:43:13 EDT 2002


    James> (a) As Carl explained, the "one way" motto is fundamentally just
    James>     a "cute saying."

No it's not.  You point to one or two examples where there are multiple ways
to do things and then generalize to say that the "one way" motto is nothing
more than PR speak.  You fail to see all the times it's been applied
successfully because those proposed features never made it into the
language.  Guido applies it routinely.  If he didn't, I suspect we'd have a

    do:
        ...
    until: ...

or

    repeat:
        ...
    while: ...

construct (or some other variant), and maybe one or two ways to spell
"switch" (which I note even Perl doesn't have - I guess Guido's waiting for
Larry to bless it ;-) in the language by now.  Both have been asked for many
times.  In fact, there's even a PEP for a switch statement.  I believe the
fact that you sometimes find overlapping language constructs can be
attributed to one of the following two reasons:

    1. They overlap in some respects, but their natural "domains" really
       don't.  This applies to your for/while/list comprehension/map
       example.  BTW, you don't really need any of these iterative
       constructs.  After all, we have functions and the language supports
       recursion.  I say, let's get back to basics.  ;-)

    2. Language design being what it is (an art rather than a science) and
       Guido's time machine notwithstanding, even the Dutch don't have a
       crystal ball to look into the future to see what the perfect language
       is.  Generally, Guido's gotten it right.  That's why so many of us
       enjoy using Python.  Still, he admits to the occasional weak moment
       (lambda, for example).  As Steve Holden pointed out, once in the
       language, core features take a long time to get rid of.  That's an
       application of "practicality beats purity".  If Guido deleted every
       feature from the language as soon as he developed something better to
       replace it, I suspect he and Tim might be the only people using
       Python.  It would be a very "pure" language, but not very
       "practical".

-- 
Skip Montanaro
skip at pobox.com
consulting: http://manatee.mojam.com/~skip/resume.html




More information about the Python-list mailing list