Software Development

YAGNI

Definition

"You Ain't Gonna Need It" (YAGNI) is a principle of Extreme Programming (XP) that states a programmer should not add functionality until it is deemed necessary.

Why It Matters

YAGNI prevents developers from wasting time building features that are not currently required. It fights the tendency to over-engineer and build for a hypothetical future that may never come, which adds unnecessary complexity and cost.

Contextual Example

A developer is building a user profile page. They might think, "Maybe in the future we will need to support multiple addresses." YAGNI principle says: unless there is a firm, immediate requirement for multiple addresses, only build the functionality for a single address. You can add the complexity later if it becomes necessary.

Common Misunderstandings

  • YAGNI does not mean you should write bad code or ignore good design. It means you should not build features that are not in the current requirements.
  • It is a key principle of lean and agile development.

Related Terms

Last Updated: December 17, 2025