DEV Community

Jordan Bravo
Jordan Bravo

Posted on

When Not To Use Python

Python is useful in some specific situations:

  • Scripting
  • Wrangling data
  • Large number of ML libraries with Python bindings to underlying C/C++

It is a terrible choice for backend web services in enterprise environments across a team.

Hypothetically it's a good fit for startups that need to quickly hack together a minimum viable product. The problem is that all too often there is no time to rewrite it as the company grows. Python's design does not discourage bad habits and in fact promotes some of the bad habits.

Problems with Python:

  • Significant whitespace
  • Slow
  • Dynamic typing
  • Async is an afterthought
  • Python 2 to Python 3, broken APIs, essentially a new language
  • Installation and environment is a headache:

    - Installs globally to system

  • Global variables
  • Mutable by default
  • Implicit export (everything is exported)
  • Imports/namespacing
  • Heavily leans into object oriented code
  • Allows shadowing and overwriting, and variable declarations don't use a keyword. This might seem like a good feature at first because it's less typing, but it's actually terrible when working in a large complex codebase. Example: I write 'data = xyz', but elsewhere in the code there exists 'data = abc', I will have no idea that I just overrode a variable.

Top comments (0)