vishal patel
Applied in productionFoundationUpdated 2026-09-23

KISS, DRY, YAGNI & Rule of Three

The pragmatic trio — keep it simple, don't repeat knowledge, don't build what you don't need yet — and when each one actually applies.

simplicitypragmatismrefactoring

The three

  • KISS (Keep It Simple): the simplest design that meets today's requirements. Complexity must earn its place.
  • DRY (Don't Repeat Yourself): every piece of knowledge has one authoritative place. This is about knowledge, not similar-looking code.
  • YAGNI (You Aren't Gonna Need It): don't build for speculative requirements. The cost isn't only the build; it's carrying and maintaining it.

The tension

diagram

Duplication is far cheaper than the wrong abstraction (Sandi Metz). Two pieces of code that look alike but change for different business reasons should stay separate. Merging them couples two things that aren't related.

An architect's version

PrincipleAt code levelAt architecture level
KISSPlain functions before class hierarchiesMonolith before microservices; Postgres before Kafka
DRYShared validation schemaOne source of truth per data item; events carry it to others
YAGNINo config flags "just in case"No multi-region until an SLO or customer needs it
Where I've used it

When extending release APIs for cross-locale items, we reused the existing SKIPPED status and error envelope instead of inventing new statuses and error codes. That's KISS and DRY at the API-contract level: clients already understood those shapes, so nothing new had to be learned or versioned.

Sources & further learning

Videos, courses, docs and books I recommend for this topic.

Related topics