Why I hate Python

Python is a very inelegant language. Here are some things I dislike.

Python is a very common language, but it feels poorly thought out. For me, clarity over cleverness is the key selling point of a programming language, and I favor object oriented languages because it matches how I think about the world (as described in English).

Here are a few examples of how Python is an inelegant “duck tape” language. For examples, see the Gist below.

  1. The syntax for lambdas (functions as first class objects) in python is very clunky. Only a comma indicates where the block ends, and it has to fit on one line.
  2. Object oriented features feel like an afterthought. A class name is sometimes required as a function parameter in order to call a base class.
  3. Python users often abbreviate unnecessarily, making it hard to know exactly what module you’re including
  4. There are some magic built in global functions, like len() which should be member functions of the relevant classes.
  5. Standard libraries are also inconsistent in their naming conventions, like unites which uses setUp instead of set_up
  6. Again with the OO after thoughts. Why must self be passed to every instance method?
  7. Similarly, decorators like @staticmethod are used to retrofit common language features.
  8. A python dictionary (a very common data structure) has odd initialization semantics. Here are some code examples.