Principes SOLID
Five structural rules for object-oriented code. One class does one thing (single responsibility). You extend it without editing it (open closed). A subclass stays substitutable for its parent (Liskov). You split fat interfaces rather than forcing a class to implement methods it never calls (interface segregation). And you depend on abstractions, not concrete implementations (dependency inversion). Formulated by Robert Martin in the early 2000s, they describe a property of code: the ability to change one part without breaking another.
Strengths
- Provides shared vocabulary to say why a file is too big, instead of feeling it without being able to argue it
- Vocabulary stable for twenty years and language independent: what you learn here does not expire with your framework
Limitations
- Applied mechanically, they produce a layer of interfaces and abstractions that costs more to read than the code it protects
- Designed for classic object orientation: transposing them to functional code or plain modules takes an effort of translation
Best for
- Splitting a codebase your agent can no longer modify without breaking something else
- Putting a precise word on a structural problem during a code review