My Good-bye to Python

I first began writing Python sometime in the early aughts. Python 2.4 was released in late 2004, so it must have been slightly before then. I saw it as an interpreted, loosely-typed language that could fill the spot in my toolbox then occupied by Perl: quick & small scripts for assorted chores. Except that instead of Perl's "there's more than one way to do it" ethos, Python was opinionated in the way that its code should look. I was initially skeptical (particularly of structure through indentation), but quickly found that this was a feature, not a bug. I'd been bitten too many times by making a mistake in my Perl code, only to have the erroneous text mean something to the Perl interpreter– just not what I meant. Instead of getting some kind of error message, the program would run off & do something completely unexpected, leaving me mystified as to where I'd gone wrong. In contrast, Python told me what I'd done wrong & where. I would argue that Python was a step back from Perl's CPAN in terms of discovery & installation of third-party packages, but then the Python standard library was so rich I didn't notice. With surprising speed, I found myself having dropped Perl in favor of Python for my sysadmin/ops work.

That was where my Python programming stayed for many years. I think this was parly due to the fact that I took a job involving high performance computing (where Python scripting was not terribly salient). With hindsight, I think it was also due to the fact that the Python community ran off down the path of making Python a full-fledged application development language, which didn't particularly interest me. Interpreted languages, by definition, remove the "compile" step from the edit-compile-debug loop. Python even included a REPL (which I found very useful). However, that "compile" step turns out to be really useful as your program grows; interpreted languages are orders of magnitude slower than compiled, and Python applications duly developed a reputation for being slow. When I moved to LinkedIn, I had this confirmed personally. An internally developed Python tool that engineers use daily needed five seconds simply to produce a help message, let alone do any work. I recently attended a Meet-Up at Facebook where one of their engineers made the same complaint about one of their tools implemented in Python.

Similarly, loose typing makes it easier to get a program up & running, but quickly becomes a hinderance as the complexity of the program grows. Python applications also have a reputation for flakiness– this is no surprise, since entire classes of errors that could have been discovered at compile-time in other languages are only discovered at run-time in Python (at much greater cost). I recall in a major (internal) outage that could have been avoided had semantic intent been made clear via a type system.

Still, there would be no reason that I couldn't happily continue to use Python as I see fit, and leave the Python app devs to their work, if it weren't for Python3. Python2 is being sunsetted & replaced with Python3, an backward-incompatible language. I've spent some time reading the rationale behind that decision, and I don't really disagree with anything I've read, but it does force me to consider the question of what language I want to use going forward, since I'm going to have to adapt to a new language regardless.

I spent more time taking a look at Python3, and was left unpersuaded. They seem to have addressed some of the performance issues, and serious syntactic changes like PEP-484 don't seem to have gained a lot of traction, but I can't shake the sense of a bloated language trying to do too much. I'm even more concerned abut the social aspects of the project than the technical. Guido stepping down as "benevolent dictator for life" is not, in itself, troubling, but the acrimonious way in which he did so suggests problems. The PR removing "master/slave" terminology from the Python docs, as well as the PR removing so-called "ableist and pejorative" terminology reinforce my sense that this is a community that's gone off the rails (this is an (unintenionally) hilarious article on the kerfuffle).

At the same time, I've realized I'm already working, as part of another project, in a loosely-typed, interpreted language with a REPL, and that I find that language far more pleasant than Python– Scheme. Ten or fifteen years ago, I might have stuck with Python for reasons of perceived employability or required skill-set. Today I'm far more inclined to simply write in what I enjoy, free of the supervision of self-appointed language police.

A few days ago I had a little task that I needed to script: I got it done with a few lines of Scheme, and ran it using Guile. No-one audited my adherence to newspeak. Good-bye, Python.

11/13/19 16:21

Have a comment on this post? Start a discussion in my public inbox by sending an email to ~sp1ff/ list etiquette), or see existing discussions.