I used to overthink everything. I wanted to lead every project, hold every thread, and be right every time. I gave to people with my whole heart, whether or not they deserved it.
Then I learned SOLID, and one day I realized these five principles weren’t describing my code. They were describing real life.
S: Single Responsibility Principle
In code: A class should have one reason to change. When one module does everything, everything breaks together.
My old behavior: I wanted to lead in everything, and I wanted everything in my hands. I called it “being responsible.”
In reality I was a God class: one person, a hundred responsibilities, zero room for anyone else to do their part. And a God class has a hundred reasons to break.
Now: I lead where I’m strong, and I let other people own their part. A team works better when each person has one job and the trust to do it.
in Tunisia , my homeland we say :
”حمل الجماعة ريش“
“The group’s burden is as light as a feather.”
=>Sharing responsibilities makes everything easier.
O: Open/Closed Principle
In code: Open for extension, closed for modification. You can add new behavior without breaking what already works.
My old behavior: I overthought everything. Every time a doubt showed up, I went back and modified a decision that was already working. And like modifying working code, every edit risked breaking it and created new doubts.
Now: Once a decision works, I treat it as closed for modification. When new information or a new doubt arrives, I extend instead: I add a next step, a plan B, a small adjustment, without rewriting what I already decided. Less noise in my head, and decisions that actually stand.
“الذهب يرق يرق وما يتقطعش”
“Gold can become thinner and thinner, but it doesn’t break.”
=>You can change and adapt without losing the core.
L: Liskov Substitution Principle
In code: If you replace a parent type with a subtype, the program must still behave correctly. A subtype can’t demand more than its parent did, or deliver less.
My old behavior: I wanted to be the leader, and I never said “I was wrong.” But a leader comes with a contract: people expect you to own your mistakes. My version of leading only worked as long as I was never wrong. I had quietly added a condition the parent type never had, and dropped a promise it did make.
That’s a Liskov violation: I carried the “Leader” label, but I behaved differently exactly when it mattered, so the people depending on me got a surprise.
Now: I learned that “sorry” is part of the contract. A leader who can say “I was wrong” behaves like a real leader, so people can depend on me without surprises.
“Practice what you preach.”
I: Interface Segregation Principle
In code: Don’t force a client to depend on methods it doesn’t need. Expose small, focused interfaces, not a giant one.
My old behavior: I’m a giver. I gave with my whole heart to everyone, everywhere, and everyone got the full interface: my time, my energy, my attention, my yes, even when they only needed one method.
Now: I learned that “no” is a valid method, and that not everyone, and not everywhere, gets full access to me. Different people get different parts of me. I’m still a giver, but now I choose which interface each person gets.
“الماء الماشي للسدرة، الزيتونة أولى به”
“Water going to one tree could be better used by the olive tree.”
=>Direct your resources where they are needed.
D: Dependency Inversion Principle
In code: High-level modules shouldn’t depend on low-level details. Both should depend on abstractions.
In everyday life: Think of a lamp. It doesn’t care whether its electricity comes from solar panels, a gas plant, or a wind farm. It depends on one thing: the socket. The socket is the abstraction. The power plants are details, and they can change without the lamp ever noticing.
My old behavior: My decisions were plugged straight into the power plant. They depended on low-level details: my mood that day, what someone said, how people reacted. When the detail changed, my decision changed with it.
Now: I plug into the socket: my values. Moods, opinions, and reactions are still there, but they are details. My decisions and those details both answer to the same standard, so things can change around me without everything going dark.
“Don’t put all your eggs in one basket.”
The Real Lesson
Every principle pointed to the same thing:
S: You don’t have to carry everything.
O: Don’t keep rewriting what works; add to it.
L: Honor what your role promises, including owning your mistakes.
I: Not everyone needs, or deserves, all of you.
D: Base your decisions on your values, not on moods or reactions.
I came to SOLID to write cleaner code. It made me a better person instead.
Which principle do you recognize in yourself? Share it in the comments, and add your own proverb. I’d love one in Arabic , French or your native language too.
For developers: If you want to apply SOLID in your code (and with AI), I built open-source skills for it: clean-code-skills on GitHub. I also wrote about how they work here: Clean Code in the Age of AI Agents: 5 Principles and 2 Skills I Built .
Top comments (0)