Frameworks and Reinventing the Wheel📄 BetterWays.dev wiki page | 🕑 Last updated: Apr 24, 2022
"Don't reinvent the wheel, just use framework X" is a popular phrase today in many software development circles.
As the test of time showed us, the wheel is as close as possible to the perfect invention, perfect concept.
How close are modern frameworks to this perfect invention? How many of them could actually stand the test of time? How about 20 years? 10 years?
Ok, how about the concepts they are built upon - OOP towers of abstraction, ActiveRecord (anti)pattern and Rails clones, or more recently, various SPA architectures?
Long term implications
Although they are usually started with good intentions, frameworks very often end up being pools of bad practices. There are many trade-offs they have to do to be as generic as possible and easy to grasp for less experienced developers.
What's really important to understand is that your whole codebase is chained to their often-very-flawed implementation of the often-very-flawed concepts.
What happens when the features or implementations you depend upon are changed or removed? Or when you'll need more control over them?
What happens when the whole framework (or its version) becomes obsolete or abandoned?
What's the alternative?
Good custom architecture (specific to your application) will outlive any ready-made framework, you won't lose the ground beneath your feet and you'll have full control over things. But it requires much more experience and effort.
Although this obsession with frameworks has gone too far, this doesn't mean no one should ever use frameworks, far from that. It just means that you should make sure that you really understand the long-term trade-offs of the decision you're making.
Just keep in mind that these "wheels" are very fragile, and can't be easily replaced.