"sins" (aka, acknowledged language problems)

Tim Peters tim_one at email.msn.com
Thu Dec 16 21:59:12 EST 1999


[Alex Martelli]
> Browsing on the Perl sites recently, I came upon:
>
>     http://www.perl.com/pub/1999/11/sins.html
>
> which is a very interesting acknowledgment of
> some of the problems with Perl, including how some
> of them used to be there but are now fixed (or in
> the process of being fixed) while others are there
> to stay.

Yup, it's a very good article!  So is its predecessor (Tom Christiansen's
"The Seven Deadly Sins of Perl").

> I wonder if there is some analogous URL, on the
> Python sites, that I could quote right next to this
> one when I'm providing people with reasons they
> might want to consider switching from Perl to
> Python.

There is not.  A couple years ago I started a thread (see DejaNews) called
"Why Python Stinks", hoping to uncover enough suppressed outrage to write a
similar article about Python (my motivation was much like yours below).
People were kind enough to whine about their pet peeves, but there was no
consensus!

For example, a few whined about whitespace, but that's a minority complaint.
I personally would nominate

    7 / 2

returning 3 instead of 3.5, but I think that's a minority view too
(although, in this case, that doesn't matter because Guido shares it
<wink>).

Another of mine is that:

    try:
        whatever
    except NameError, OverflowError:  # this is the line
        something

does something totally unexpected (unless you expect what it does ...).
Nobody defended that, but it's also not a *common* mistake (trying to catch
N exceptions is unusual for 1 < N < infinity).  So while it's a sin, it's
barely worth mentioning.

Many complaints were isolated gripes about "missing features" from other
languages (e.g., no lazy evaluation).  While such things are disappointments
to the complainers, they rarely have significant constituency.

Other complaints were about the features that *can* have surprising
consequences, and that lots of people seem to bump into once or twice before
they "get it".  Mutable default arguments are the clearest example of that.
Yawn <wink>.

The lack of "real GC" is shared by Perl, and that didn't make Perl's "deadly
sins" list, so it shouldn't make Python's either (besides which, many people
here *like* the relative predictability of refcounting!  just as they do in
Perl-land).

Lexical closures (or, rather, the lack of them) has been the subject of many
flamewars here over the years.  There's no consensus on that either.

Note that the Perl list comprises things that almost all Perl programmers
agree about, and even after years of Perl programming (e.g., the confusing
reference syntax).  That's why I keep mentioning "consensus" above.  The
fact appears to be that Python has only one "deadly sin" by that criterion:
the split between "types" and "classes".  But you can program productively
in Python for years before even *noticing* that!  It's a "deadly sin" to
some old-timers, and to many  extension (in C) writers, but not to the
majority of Pythoneers (bless their ignorant little hearts <wink>).

> After all, saying "here you will find, on
> the Perl site, documentation on Perl defects, that
> Python does not share -- Python, on the other
> hand, is absolutely perfect" (:-) would not exactly
> carry much strength... it would no doubt convince
> the recipient that Pythonistas are fanatics, unable
> to own up to their problems, while Perlites, while
> labouring under many hard language problems, are
> at least aware of them.

OK:  Build a web page that says

     Python's "lambda" sucks

Only about 50% of Python programmers would dispute that one <0.5 wink>.

if-individual-peeves-were-deadly-sins-we-could-overflow-
    hell-ly y'rs  - tim






More information about the Python-list mailing list