YAGNI - You Aint Gonna Need It

YAGNI is an old XP term created to remind programmers not to over engineer their systems.


In the 90s, in an attempt to future proof their designs (or just impress their colleagues), developers were sometimes tempted to over design their systems.

Sometimes it was innocent (like wanting to try out a new Gang of Four pattern). But many times it was complexity for complexity's sake - and it resulted in a lot of waste in terms of time and maintenance.

One way XP’ers would keep themselves honest is to insist they write a failing unit test (demonstrating the need for complexity) BEFORE adding the extra complexity to the system.

That combined with XP’s rules for simplicity:

  1. The design runs all the tests.
  2. Communicates everything the programmers want to communicate.
  3. Contains no duplicate code, and
  4. Has the fewest possible classes and methods.