Python 3 is killing Python

Chris Angelico rosuav at gmail.com
Wed Jul 16 06:20:37 CEST 2014


On Wed, Jul 16, 2014 at 1:51 PM, Steven D'Aprano
<steve+comp.lang.python at pearwood.info> wrote:
> Perhaps the *stupidest* thing the author of the "Python 3 is killing
> Python" blog post wrote was that it's easier to port Python code to a
> *completely different language*. I cannot fathom the idiocy of somebody
> who bitches and moans that having to re-write or redesign, oh, let's
> conservatively say 5% of your Python 2 code is harder than writing your
> code *completely from scratch* in a completely different language, with
> completely different third party libraries.

There's only one way that it's easier to port to a completely new
language. Pick another language where string handling is as naive as
my last boss (who told me to make sure that my code was "eight-bit
clean, that is to say, Unicode safe", and used the words "Unicode" and
"UTF-8" as synonymous), and then you can continue to stick your head
in the sand and pretend that ASCII is what matters, that "special
characters" work because of the magic of UTF-8, and that oh, yeah, I
guess we'd better occasionally test our code with a few of those
annoyingly different characters, but ehh, it doesn't really matter
much.

Having been guilty of something like that (actually, in one program I
assumed all the incoming text was CP-1252, so it really *was*
byte==char), I am extremely aware of the problems that it causes. But
it does make initial coding a lot easier - at the expense of debugging
later, when you discover that some things don't work. The Py3 approach
forces you to fix things up-front, and that's hard! But then there are
no bugs.

I know which one I'd rather.

ChrisA



More information about the Python-list mailing list