Skip to content
Go back

My Take on SOLID

Edit page

People learn SOLID and treat it like a set of commandments — five neat rules that are supposed to make code cleaner, safer, more “architectural.” But SOLID isn’t a recipe. It doesn’t make your code good — it makes your thinking visible. And that’s usually where the problems start.

Each of those letters isn’t a rule. It’s a stress test. A mirror that asks, “Do you actually understand what this thing does?” If you treat SOLID like doctrine, you’ll just parrot design patterns. If you treat it as a way of thinking, you’ll start to see where your code — and your reasoning — fall apart.

Take the Single Responsibility Principle. It’s not about counting functions or splitting files until they look small. It’s about whether you can describe what this thing does in one short sentence — usually without “and” or “or.” If what you say sounds like one thing, you’re fine. That “one thing” might involve ten smaller steps, and that’s okay — as long as they all serve the same idea. But if your description turns into a shopping list with no theme, you don’t have one responsibility — you have a pile.

The Open/Closed Principle isn’t about locking your code behind glass. It’s about keeping the core idea steady while the details can change. Any real system has a few things that define what it is — and a bunch of smaller things that describe how it behaves in specific cases. Those two shouldn’t share the same life cycle. You should be able to tweak the details without touching the core, and combine them in new ways without fear. When that balance feels right, you don’t need to “make code open for extension” — it already is.

Liskov Substitution Principle isn’t about inheritance trivia. It’s about honesty between the abstract and the concrete. Every abstraction makes a promise — a behavior, a contract, an idea. Concrete implementations are just ways to keep that promise. The moment one of them can’t, substitution breaks. If your code says it works with the abstract thing, it should work — no matter which concrete version you hand it. If it doesn’t, your abstraction is lying, and the whole design starts to wobble.

Interface Segregation Principle isn’t about splitting things for the sake of neatness. It’s about precision. Every interface is a promise — “I can do this.” The point is to make that promise fit the situation. Code that reads data shouldn’t be forced to promise it can write it. A payment processor shouldn’t also promise it can issue refunds unless that’s truly the same role. Each interface should reflect one clear perspective — a role the entity plays in a specific context. When those roles stay focused, your code fits together naturally. When they blur, everything starts pretending to be everything else, and you end up with APIs that apologize for existing.

Dependency Inversion Principle isn’t about throwing abstractions everywhere. It’s about control — deciding who sets the rules and who follows them. In good code, higher-level ideas don’t depend on low-level details; they depend on meanings. The lower-level parts adapt to those meanings. When you get that inversion right, the direction of dependency matches the direction of intent. The important ideas stay in charge, and the details orbit around them. When you get it wrong, your architecture flips — the code that should lead starts following, and the code that should follow starts making decisions.

That’s what SOLID is for — not to make your code prettier, but to make your reasoning sharper. It’s not a checklist, it’s a way to notice when your logic starts mumbling. Treat it like a conversation, not a rulebook.

That’s my take on SOLID — less about purity, more about clarity.


Edit page
Share this post on:

Previous Post
Good Developer, Wrong Place
Next Post
A funny way to restrict access to website hosted on S3