Connor's Blog

3 min read Original article ↗

Breaking Up With Python

For years, Python has been my go-to language for a quick bit of scripting where another language might feel too heavy duty. As time has gone by, I’ve grown more and more disillusioned with it to the point where I now avoid it if possible in favor of something like Go or JavaScript.

Python’s documentation sucks

Sorry. It’s absolutely terrible. Take this page for instance. It’s horrible to navigate. How do I see a list of functions exposed by this module? I can’t. I have to scroll and Ctrl+F to find what I’m looking for.

Now take Go’s documentation for net/http. The sidebar has a clear view of all constants, variables, functions, and types exposed by this package. The design makes much better use of screen space and there’s a search modal that shows instant results.

Python’s package management sucks

Every project seems to use a different tool and it’s a massive headache. Off the top of my head there’s:

  • Pip
  • Pipenv
  • Poetry
  • Virtualenv
  • Conda
  • Twine

…and probably others I’ve forgotten. It’s exhausting when you need to get a Python project working and it uses a snowflake package manager you’ve not encountered before. Not to mention the frustrating issues you can encounter if one of the dependencies uses C bindings. In my experience, such issues are usually hellish to resolve.

Python’s standard library sucks

It’s extremely barebones. You can do some basic things with it but the HTTP server/client is far from production grade. On the other hand, you can write a robust Go backend without needing to import a single dependency. Go’s net/http can suffice. Go’s standard library has pretty much everything you could ever need.

Expect to add a dependency to your Python project the moment you go beyond Hello World.

Python is slow

This isn’t exactly a secret. We all know about the GIL. There have been efforts to optimise the runtime in recent years but it’s still nowhere near the performance of V8.

Python is huge

The python:3.9-slim Docker image is 118MB! Once you add your own code and its dependencies, you can expect it to be even larger, especially if you can’t use the slim variant for some reason.

Python sucks

I mean the syntax itself. It’s like everything under the kitchen sink has been jammed in. Like there’s a serious lack of coherent design or vision. Type annotations were a step in the right direction but they don’t even do anything! Why!?