Fuck Python
Sep 5, 2018 · 2 min read
I have never really used Python, and I probably will have to learn it someday. Below I list some shortcomings and compare them to JavaScript. The problems with Python that I fear I will have to wrangle with:
- Scoping — having to use
nonlocalto scope closures. JavaScript does not have this problem, JS is nice and smooth in this regard, scope is “linear”. - Variables don’t get declared, it’s hard to tell when a variable was initialized or reinitialized/overwritten. JS does not have this problem — JS has
constandletandvar. “I hate that Python can’t distinguish between declaration and usage of a variable.” “Nothing in Python prevents me form overwriting or reusing variables.” - Python version 2 or 3, which to use?
- the GIL — the Global Interpreter Lock — JavaScript avoids this problem by being “single-threaded”
- JavaScript/V8 runs faster than Python, around 5–10x, Python is one of the slowest languages around.
- whitespace for syntax — also known as the “offsides r ule”— fuck every single programming language that utilizes whitespace for syntax (including YAML) and fuck the authors of those systems as well. JS does not suffer from issues relating to this horrible design choice.
- Object Orientation was tacked on — passing ‘self’ to methods? wtf. it’s actually not that bad from a developer perspective, but I assume performance is bad since all the methods need to bound to each instance, every time an instance of a class is created?
- Python is dynamically typed — that’s a major downside for most real applications. Obviously a problem that JS has as well, that only TypeScript can fix.
- No support for multi-line anonymous functions.
- Swallows errors — at least Python3 — I am looking a python program right now — program will exit even though there is clearly an error but no error trace shows up — I am not swallowing the error with a try/catch, python is swallowing it, and that’s not good.
- Python error stack traces — they are horrible, I don’t think it’s a matter of getting used to — they are just really painstaking to sift through.
