Python SNAFUs
Incoming links: What 127.5 million forms can tell you about the state of front-end input validation on the Web Ugh, Rust
While I never liked Scala, I used to be a Python fan. Python is the language that taught me to write larger programs. It's still what I reach for as an alternative to shell scripts. I've stopped enjoying it though, for a few reasons:
- The packaging situation is a mess, and there is no good solution if what you want is to make a "program"; a unit you run as a script or GUI application. This situation is made a lot worse by the fact that the standard way of making HTTP requests is a package, which means that any program that calls anything on the Web is now requires a bunch of brittle rituals to run. All my Python programs periodically keel over and require new virtual environments, adding useless maintenance that takes a surprisingly large amount of time.
- Python keep having weird defaults that are hard to work around. Why does the CSV parser have an odd maximum field size stored in a global variable that you can modify and where some values on some platforms break?
- Types are good, actually. I once worked professionally on a large Django codebase where I silently broke an important piece of business logic by expecting an integer from the database when it returned a string. Of course all the comparison operators worked fine, and all tests passed.
- Object oriented programming using inheritance is a terrible way to organise your code. It makes it hard (or, if you allow reflection, impossible) to find an execution path for a given input. This problem is made a lot worse when it's combined with magic ORM wrappers or frameworks, of which Django is probably the worst example.
- Python is the only language I know that's so slow it was explicitly banned in an algorithms course I took because it didn't matter if you implemented your algorithm perfectly – the language itself was so slow it didn't matter.