Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tlug] Supporting Old Versions of Python 2 (was Re: perl? (was: Employment for "oldies"))



jep200404@example.com writes:

 > You have been using Python longer than I. Within the Python 2
 > series, how much have you seen a newer release break old code?

For about 3 months after each 2.x.0 release that was a lot of traffic
on python-dev (which is a 10-50 posts/day list normally), and many
issues ended up as bug reports and never really made it to the list.

I think a lot of the problems are with keywords and the occasional
special object (True, False, Ellipsis).  Personally I have never yet
written code that didn't port forward within 2.x, but I didn't have
personal definitions of True and False like many people (since I come
from a Lisp2 background, I'm used to truthies and falsies -- shut up,
Josh, that's your fetish not mine), or I would have been caught
between 2.1 and 2.2.1.  I can't remember what language it is, but
apparently the "with" statement (which made "with" a reserved word)
caused problems with variable naming for some people.  Aside from
keywords, syntactically valid Python 2 remains valid Python 2 from one
release to the next.

A much bigger problem I think is the practice of actually removing
deprecated APIs.  These are almost entirely cases where *your* program
is actually producing *incorrect* results by using the API outside of
its documented domain, and eventually the API is removed in favor of
an API that does proper input checking or requires a parameter
specifying which of several plausible behaviors the caller actually
wants.  So your program stops producing any results at all.  Given how
much most programs suck and still get away with it, this is obviously
a bad thing because they stop getting away with it.

IMHO the "it's better to fail with an error than produce incorrect
results" attitude is one reason why Python has a lot of uptake in the
scientific computing community.  It's hard enough to figure out what a
Perl program is supposed to do, but even harder to be reasonably
confident that that's what it does in edge cases!  Caveat: I have no
idea if there are pragmas that change Perl's DWIMmish behavior
vs. barewords and strings interpreted as integers etc.  If there are,
and they are actually used in the great majority of CPAN modules, I'll
retract that (for myself, but I wouldn't be surprised if the meme
lives on!)

While I basically agree with Josh that it's generally a good sign when
a CPAN module hasn't changed in 10 years but is still in very common
use, I don't take that as being as reliable as TeX or secure as
qmail. I treat my programs the way I treat my dog: give 'em love at
regular intervals (much more frequently for the dog!)  But I can
understand the frustration of the sysadmin who wrote a 90% program
where he has to read the output anyway and can just ignore bogosities
that are invariably obvious, when that program stops working at all!



Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links