Dijkstra on Python

Steve Holden sholden at holdenweb.com
Wed Aug 14 11:29:27 EDT 2002


"nnes" <pruebauno at latinmail.com> wrote in message
news:d8778a53.0208140319.506f2193 at posting.google.com...
> "James J. Besemer" <jb at cascade-sys.com> wrote in message
news:<mailman.1029211160.24826.python-list at python.org>...
> > Al Vining [and many others] write:
> >
> > > "There should be one -- and preferably only one
> > > -- obvious way to do it."
> >
> >
> > However, Python itself breaks its own rules at the low level; e.g. with
> >
> >     for
> >     while
> >     map, et al.
> >     list comprehension
> >
> > ... Python offers at least 4 redundant ways to iterate over a
collection.
> >
> or lamda which seems to me like a special case of def. Or print which
> is a special case of write() on the standard output. etc.
>
> And the BDFL regrets it (specially read pages 3-5):
>
> http://www.python.org/doc/essays/ppt/regrets/PythonRegrets.pdf
>
> The problem is since Python is an evolving language it may take some
> time until the BDFL (by analysing python code/patterns) finds the
> preferable and obvious way to do it. To parafrase: The "preferable
> only one way" may not be obvious at first unless you're Dutch, and
> even then it is tricky :-). In the meantime we are experimenting with
> different alternatives.
>
> I can only hope that Python goes with the "less is more" aproach and
> starts deprecating some of this stuff, instead of just adding new one,
> so that newcomers will use "preferable only one way", making it easier
> to read their programms.
>
Well, lots of stuff is due to be deprecated, but one of the problems is the
screams of horror that appear in this newsgroup whenever anything is changed
in a potentially non-backwards-compatible way.

> A good example of this last is xreadlines which will be deprecated in
> 2.3 and will be replaced by: for line in file. This was more of an
> performance issue in the old implementation than anything else. But a
> lot of my code used it, because it was faster under 2.1. So now I will
> actually having 2 ways to do the same depending on the Python version:
> the 2.1 way and the more cleaned up way.
>
> Hopefully the language will converge to cover 90% of the common tasks
> at hand using obvious syntax, and these being the speed optimized ones
> to encourage its usage.
>
> I still prefer growing pains to no growth
>
Me too. I'm hoping that the Python Business Foundation's work to provide
more stable, longer-lived, Python environments will allow the language to
keep changing without affecting whatever commercial success it's achieveing.

regards
-----------------------------------------------------------------------
Steve Holden                                 http://www.holdenweb.com/
Python Web Programming                http://pydish.holdenweb.com/pwp/
-----------------------------------------------------------------------








More information about the Python-list mailing list