Alex Stevovich
Writing

OOP Singleton Ride or Die

The author's avatar
By Alex Stevovich
June 13, 2022

Fingers on the switches tucked, mask up. Whole gangs on the spot. Word hit sayin we messy, that my crew don’t scale, tryna clown the set. That’s foul. That’s disrespect. They called us an anti-pattern. So we spinnin on that. HA!

Me and my crew, OOP and Singleton, we go way back, and yea, DI's in the mix too. I’ve known these guys from the start. You know, if I could tell my past self one thing, it’d be this: ignore the noise. The reality is simple, OOP/DI is what you’ll use most of the time and Singletons are good. The internet says otherwise, but I’ll show you why.

There's a lot of dogma in programming culture, hard to say where it all comes from, I'd wager narrow roles or methodologies in enterprise culture, academia, the internet, and a lot of people that program work in just one channel and there's a lot of variety. Depending on whether you're in an enterprise or non-enterprise, and the type of field you're working in, the rules can change dramatically. Remember, enterprise doesn't mean better—it means more people and more risk aversion.

Let’s get one thing straight though: OOP is king. Outside of a few niche applications, it’s the go-to paradigm in the majority of programming domains. Period. OOP is your bread and butter. You can debate it all you want, but when it comes down to it, most software runs on the principles of OOP. For the vast majority of use cases, it works, and it works damn well.

Lived programming experience disassembles most major dogma, it’s all fallible, and understanding the pitfalls by experiencing them yourself matters more than following advice randomly. The biggest problem isn’t a binary "never use this, only use that", the most common issue I face is just weighing the pros and cons of a solution, which involves thinking of the future, potential and scale, and how much cost you're willing to invest for a complexity level that a program might never reach.

Singletons have lots of usages and appear in many professional-grade software where they are highly effective and essential in many of these cases.

The best advice? Just walk on your programming journey. Making mistakes in programming gives you a lasting memory of what went wrong. You don’t forget those lessons. Over time, you start to recognize the pitfalls before you even hit them, and that’s what helps you make better choices in the future. You've been on that road before you know where it leads.

So when people say OOP and Singletons don’t scale, don’t matter, don’t belong? That’s disrespect. The world runs on this and THAT’s why we own this block and you ******* ****s don't.

Ride or die.

© 2022 Alex Stevovich