Principles, practices, and slogans
Why SOLID is bad
The two core principles of Agile
User-centric design
A principle is a guiding truth that remains valid across tools, languages, and fads.
Principles are few, stable, and context-agnostic.
It describes why you act, not how.
A practice is a repeatable way of working that applies one or more principles.
Practices are tools, not truths.
It is situational and evolves with technology or culture.
A slogan is a simplified statement that once hinted at a principle or practice but became detached from its rationale.
It’s often used as dogma instead of guidance.
SOLID is a group of five object oriented design principles coined by Robert C. Martin in the early 2000s and popularized by the software craftsmanship movement as a way to structure maintainable systems.
Reality check!
Keep classes small
Keep classes self-contained
Encapsulate properly
Every class should have only one responsibility
Reality check!
Class inheritance is usually not the way
Modifying classes is perfectly fine
Software entities should be open for extension, but closed for modification
Reality check!
Why are you inheriting or implementing interfaces?
Functions that use pointers or references to base classes must be able to use objects of derived classes without knowing it
Reality check!
Why are you inheriting or implementing interfaces?
Clients should not be forced to depend upon interfaces that they do not use
Reality check!
The trade-off of adding abstractions and complexity versus keeping the code simple is a fundamental choice
Depend upon abstractions, not concretes
There is no empirical or peer-reviewed scientific evidence validating the SOLID principles as predictors of code quality, maintainability, or developer productivity.
Solid is a slogan.
Bob Martin built a personal brand and consulting business around promoting SOLID. The principles are a cornerstone of his public persona, driving sales of training materials, speaking engagements, and corporate coaching under the “Uncle Bob” brand.
Uncle Bob invented SOLID while making photocopier software:
In a good codebase:
A good team:
Don't add complexity
(abstractions, classes, interfaces,
tools, libraries, tests ...anything!)
that you don't need right now.
Remove complexity!
Simplicity–the art of maximizing the amount of work not done–is essential.
All code that you need to change should ideally live on a single screen.
Keep related logic together.
Can you make some code simpler? Go ahead, the future gain likely pays for it.
Implement new versions of frameworks, servers, libraries aggressively. Keep the technical debt down. Remember ESPx.
You ain't going to need it
Anti-patterns
Known things which are bad™️
https://en.wikipedia.org/wiki/Category:Anti-patterns
Â
Code smells
Â
Things that should make you go: hmmmm
https://en.wikipedia.org/wiki/Code_smell
Start from the data model, define tables and relationships, and let the database schema drive the structure of the code and API.
This approach ensures data integrity and performance are prioritized, but can constrain flexibility when business needs change quickly.
Begin by modeling real-world concepts as classes, then derive persistence and APIs from that model.
It favors encapsulation and reuse, though it can drift toward abstraction and mismatch with how data actually lives in storage.
Write tests before writing code, allowing tests to define desired behavior and drive implementation.
It aims to improve design quality and maintainability, but often trades early clarity for ceremony when applied indiscriminately.
Design from the outside in: start with what the user needs to see and do, build the minimal interfaces to support it, and then backfill logic and data.
It optimizes for value and feedback speed rather than technical purity.