Why Python will die
The last 22 years have been really good for Python. It went from “just a scripting language” to the primary language used to write the backend of most Web Apps, and the most popular language on GitHub by far.
But the last 5 years have already started to reverse that upward trend, and as a lifetime Pythoneer the reason is obvious Static-Typing or, more specifically, the legacy of Dynamic-Typing.
The Dynamic-Typing Problem
Dynamic-Typing helps new programmers learn without drowning them in syntax. Python rules here, the way Guido van Rossum designed and directed the language’s development, produced a syntax that reads naturally.
Type Hints are a start, but let’s be honest; they’re an ugly bolt-on.
But, Dynamic-Typing doesn’t scale beyond basic programs and small teams, or for that matter, any situation where it is unclear what an object might contain.
To combat this, Pythoneers started using sphinx-style docstrings to provide Type Hints. Eventually, python introduced the typing
library, natively implementing Type Hinting.
Type Hints are good a start, but let’s be honest; they’re an ugly bolt-on. And, without true Static-Typing, the duct tape came out; as we pulled together tools like MyPy and Pydantic to enforce type-checking and prevent issues before they hit production.
Over time this has led to Python code slowly becoming uglier, as the Type Hinting and enforcement tooling breaks the natural language look-and-feel of Python while adding additional steps to the development process.
The Beginning of the Developer Exodus?
As a result, long-time Pythoneers are slowly starting to prefer other languages that fulfill their needs for Type Safety and cleaner code.
Most of those that are leaving are migrating to Typescript, Go, and Rust, though, personally, I’ve recently been enjoying C# (≥ .NET 8.0 / C#12) and modern C++ (≥ C++ 17) for the services I’ve needed to write.
The Future
I do not doubt that Python will survive, but the question that remains is: Will Python fade back into “just a scripting language” becoming little more than a tool for teaching students, or will it re-imagine itself again?
Perhaps as a cleaner statically-typed language, allowing it to hold onto its crown?
Who knows, but if it does remove support for dynamic-typing it would enable significant improvements in performance (just look at Cython).