Eliminating upgrade risk

Peter Hansen peter at engcorp.com
Thu Jul 26 19:39:16 EDT 2001

"James C. Ahlstrom" wrote:
> Robin Becker wrote:
> > If the advice from the Gods is that Python is a 'research' language then
> > I'll know better what to do.
> The problem is that the new Python features, as wonderful as they are,
> are chosen for Computer Science Purity, not day-to-working-day
> importance to someone actually trying to write a widely used bullet
> proof program.  The current rate of language change is fine for a
> student or casual programmer I'm sure, but I don't have that luxury.

I agree the rate of change is enough to make many of us nervous
(perhaps especially in industry).  And I agree some of the new
features appear (from my particular point of view) unnecessary
and more like CS playthings than anything else.

That said, I have to say that at least one change is likely to
improve my ability to produce bullet-proof programs.

The surgery on the way division works will almost certainly
reduce the risk of my accidentally (and quietly) truncating a
result when I really meant to say float(x)/y and forgot, since
this is an idiom I rarely need to use.  (This is leaving aside
the issue of code breakage, but I'm talking only about new
code here, and in my case I don't need to maintain backwards

Another thing I'm going to like is the generators, which 
are very likely going to help me write readable, elegant code
for several coding patterns where I now have to write
cumbersome and relatively unreadable code.

So these two things will help a lot with bullet-proof
programming.  And list comprehensions.  I suspect list 
comprehensions will also let me write more readable 
code (after I get past the ebullient phase many 
seem to go through, and tone it back a little).  There
are therefore at least three things that will help.

Since readability is the single biggest item which will
contribute to bullet-proof programs (after testing!), 
and since many of the new items should tend to increase
readability, I have to disagree with your claim.

Peter Hansen, P.Eng.
peter at engcorp.com

More information about the Python-list mailing list