Show in graph

Software → Software Design

YAGNI

A design principle that discourages building functionality before it is actually needed.

Motivation

YAGNI solves the problem of building features, abstractions, and extension points before they are needed. Premature flexibility creates code that must be maintained even if the future requirement never arrives.

Where it fits

YAGNI belongs to software design and product engineering. It pairs well with iterative development and test-driven feedback.

Mental model

Do not build the generic version until the specific version has shown you what actually varies.

Common mistakes

  • Ignoring obvious near-term requirements.
  • Using YAGNI to avoid designing clean boundaries for current behavior.