You aren’t gonna need it
Section titled “You aren’t gonna need it”YAGNI means that a team should not build a capability only because it might be useful later.
Future requirements are uncertain. Extra capability creates code, tests, documentation, dependencies, migration obligations, and design constraints that must be maintained now.
Context
Section titled “Context”YAGNI is useful when a proposed abstraction, extension point, feature, or infrastructure layer has no current requirement.
It does not mean ignoring known future constraints. Some decisions are expensive to reverse, and early preparation can be justified when evidence is strong.
Benefits
Section titled “Benefits”Deferring speculative work:
- keeps the current design smaller;
- reduces unused code and configuration;
- preserves more design freedom for the real requirement;
- moves cost closer to the time when value is known.
Failure modes
Section titled “Failure modes”Ignoring YAGNI can produce extension points that never receive a second implementation, generic systems with one use case, or infrastructure that adds operational cost without current value.
Over-applying YAGNI can also be harmful. A team can postpone necessary capacity, compatibility, security, or migration work even when the future constraint is already credible.
Decision test
Section titled “Decision test”Before adding speculative capability, ask:
- What current requirement needs it?
- What evidence makes the future need likely?
- What is the cost of adding it later?
- What maintenance cost starts immediately if it is added now?
Prefer the smaller design when the need is uncertain and later change remains practical.
Sources
Section titled “Sources”- Martin Fowler. “Yagni.”