SOLID
SOLID
ELI5 — The Vibe Check
SOLID is five rules for writing code that doesn't turn into a nightmare over time. Each letter stands for a different rule. Follow them and your future self will thank you. Ignore them and you'll spend Fridays at 5pm untangling spaghetti.
Real Talk
SOLID is an acronym for five object-oriented design principles: Single Responsibility, Open-Closed, Liskov Substitution, Interface Segregation, and Dependency Inversion. Introduced by Robert C. Martin, they guide the creation of maintainable, flexible, and scalable software.
When You'll Hear This
"This class violates SOLID principles." / "Let's refactor this to follow SOLID before adding more features."
Related Terms
Dependency Inversion
Dependency Inversion says high-level code shouldn't depend on low-level code — both should depend on abstractions.
Interface Segregation
Interface Segregation means don't force classes to implement methods they don't need.
Liskov Substitution
Liskov Substitution says if class B extends class A, you should be able to swap B in everywhere A is used without anything breaking.
Open-Closed
Open-Closed means your code should be open for adding new features but closed for editing old working code.
Single Responsibility
Single Responsibility means every class or function should do ONE thing and do it well.