Jeffrey Bakker
2 min readMay 26, 2022

--

I don’t enjoy falling for “us versus them” traps, but sure, I’ll bite…

There have been decades of common, yet egregious OOP anti-patterns that make for highly unmaintainable (and untestable) code. At least 20 years ago, Gen X and the Baby Boomer have identified how to write cleaner code via the likes of design patterns, SOLID design principles and other practices and paradigms, like MVC or CQRS. They are so important to clean code that we shouldn’t even be teaching Object Oriented Programming without these concepts.

Unfortunately, a huge chunk of Gen X can’t be bothered to unlearn what already “works for them”, and you see this in the millennial generation, too. I’ve met both great and “typical” programmers from both generations.

A particular millennial writer on Medium would make very good points on why OOP is a trap for writing shitty code. He acknowledges SOLID principles among other practices, but argues that developers shouldn’t be bothered to learn them because it’s overwhelming to have to learn a million rules on how not to shoot yourself in the foot. While he does have a point (that there’s more rules on how not to make crappy OPP code, than there are rules in OOP), this very unwillingness to learn them is a problem for all generations.

That writer’s solution to all OOP problems is Functional Programming. Now even if we all bought into it, that doesn’t mean that it’ll solve all of the industry’s problems. Most of us don’t have a choice of which methodology or tech stack to use. Most of us are hired to maintain code, which a lot of is going to give us headaches. When we do get the occasional green project, sometimes there’s a chance to choose, but tech stack choice shouldn’t be chosen just because it’s FP versus OOP; there are many other factors in tech stack choice.

Therefore, if OOP is sticking around, why not learn SOLID and the likes, instead of trying to reinvent the wheel for cleaner code? We solved these problems decades ago - but nobody’s listening.

--

--

Jeffrey Bakker
Jeffrey Bakker

Written by Jeffrey Bakker

Professional geek. Wannabe cyclist.

No responses yet