YAGNI

Also known as: You Aren't Gonna Need It

technique · computer science · organizing-schema

XP principle: don't build functionality until it's actually required.

YAGNI ('You Aren't Gonna Need It', or sometimes 'Ya Ain't Gonna Need It') is a principle from Extreme Programming articulated by Ron Jeffries and Kent Beck in the late 1990s, holding that programmers should not build functionality until it is actually required by current concrete needs rather than anticipated future needs. The argument is empirical: features built speculatively for anticipated future needs frequently turn out to differ from actual future needs when those arrive, so the speculative work is wasted while also adding maintenance burden, complexity, and the risk of constraining future design choices. Martin Fowler's 2015 'Yagni' article distinguishes the cost of build (initial development), cost of delay (interest paid on the speculative feature), cost of carry (ongoing maintenance), and cost of repair (correcting bad speculation), arguing the costs typically dominate the value of speculative features. YAGNI complements KISS and Beck's other XP practices, and stands in productive tension with thoughtful upfront design — the principle is not against thinking ahead, but against building ahead.

Originators

Ron Jeffries; Kent Beck (within Extreme Programming) high

Year / Decade

Late 1990s within XP; 1999 (Beck's Extreme Programming Explained) high

Primary sources

Beck, K. (1999, 2nd ed. 2004). Extreme Programming Explained, Jeffries, R. (1998 onward). Various XP publications, Fowler, M. (2015). 'Yagni' (martinfowler.com) high

Core components

Primary use case

Code review and design heuristic; agile and XP development practice; refactoring and feature-prioritization guidance; teaching tool for distinguishing speculative from required complexity; complement to KISS and DRY in software craftsmanship.

Common criticisms

Lineage

Child of
Extreme Programming
Siblings
DRY, KISS, SOLID Principles
Derived from
Extreme Programming