YAGNI
"Build a capability when you actually need it, never when you merely foresee needing it."
"Build a capability when you actually need it, never when you merely foresee needing it."
A feature you add because you expect to want it later costs you now and usually turns out to be the wrong feature. The principle says to wait: implement the capability at the moment a real requirement arrives, not at the moment somebody imagines one.
Rated Heuristic: a dependable rule of thumb, not a proven theorem. The other 224.
A presumptive feature is a bet on a forecast, and software forecasts are poor. If the guess is wrong you have paid for something nobody uses; if it is right, you have often built the wrong shape of it, because the real requirement arrives with details the forecast lacked. Martin Fowler enumerates four costs that land either way: the cost of building it, the cost of delaying the features you could have built instead, the cost of carrying the extra complexity in every subsequent change, and the cost of repairing it once the real need contradicts the guess. Waiting converts a bet into a decision made with information.
It is the clearest statement of a bias that costs software teams more than almost any other: the instinct to build for an imagined future. It reframes 'flexible' from a virtue into a cost with a name and a bill, and it gives a reviewer a short, quotable reason to ask why a capability exists now rather than later.
It assumes change stays cheap, which is exactly what its own methodology has to supply: the practice was stated inside Extreme Programming alongside continuous refactoring, automated tests and continuous integration, and without those the deferred work becomes rework rather than saved effort. It also bites hardest on reversible decisions. Choices that are expensive or impossible to revisit later (a data model that silently discards information, a public API, an encryption scheme, a regulatory obligation) are precisely the ones where anticipating is cheaper than repairing.
It is not an argument for careless code, for skipping design, or for refusing to think about the future. It says nothing against making a system easy to change; it says only that building a capability before a requirement exists is a bet you usually lose. Nor does it license shipping a known-inadequate design where the inadequacy is already a present, not a future, problem.
Real as a rule of thumb, not as a theorem. YAGNI is rated Heuristic here: dependable enough to plan with, and with no proof behind it.
Rated from two sources. 225 of the 1,116 entries carry this rating. How the scale works.
The best-known laws are the least likely to rest on measurement.
Stated as a practice of Extreme Programming in the late 1990s and most often quoted from Ron Jeffries, one of XP's three founders, in the form "Always implement things when you actually need them, never when you just foresee that you need them." The acronym circulated on the WikiWikiWeb before entering general use; Martin Fowler's 2015 bliki entry gave it the four-costs analysis now usually cited with it. No single publication is the first appearance of the phrase.
Everything above traces to martinfowler.com and en.wikipedia.org, two sources in all, one of them the original publication rather than an account of it. Nothing is written from memory, and the method is written down. Spot an error or a better source? Suggest a fix.