Clean Code Principles: SOLID Explained

Write code that humans can understand. The 5 principles of Object-Oriented Design.


Clean Code Principles: SOLID Explained
1 Loading...

Clean Code Principles: SOLID Explained

“Any fool can write code that a computer can understand. Good programmers write code that humans can understand.” - Martin Fowler

SOLID

  1. S - Single Responsibility Principle: A class should have one, and only one, reason to change.
  2. O - Open/Closed Principle: Open for extension, but closed for modification.
  3. L - Liskov Substitution Principle: Objects of a superclass shall be replaceable with objects of its subclasses.
  4. I - Interface Segregation Principle: Many client-specific interfaces are better than one general-purpose interface.
  5. D - Dependency Inversion Principle: Depend upon abstractions, not concretions.

Master these, and your code will survive the test of time.