SOLID - not a fan

SOLID is a way to develop your programs. I am not a huge fan, and now Prime put my thoughts into words very eloquently.

Maybe it’s good for a newbie to try to stick to SOLID, but ultimately learn its limitations and move beyond, and start valuing the ‘locality of behavior’ and simplicity principles more than going all abstraction-crazy with SOLID. In my experience, projects written using the latter principles are much easier to maintain than projects built using the SOLID principle.

  • Start as concrete as possible; use abstraction only when you realize need for it.
  • Inheritance is very hard to do right; avoid if possible. Composition over inheritance.
  • Locality of behavior is more important than blindly following SOLID principles.

In other words, maybe it’s good to start with SOLID, but then move beyond SOLID and Clean Code as you grow as a developer.

Written on October 1, 2024