YAGNI 00:00:00 Make a prediction You will separate a current invariant from a speculative extension and explain the evidence that would justify adding it. A ticket service must never sell the same seat twice. It might support six kinds of recommendation plugins someday. Which work is justified today? Atomic seat ownership serves an existing promise. A plugin discovery system has no present client. Implement the current requirement and preserve the evidence needed to extend later. 00:00:31 One night in the hills For a one-night hike, bring the water the route requires. A spare tent for a hypothetical month-long expedition weighs you down. Forgetting the actual water is not efficiency. Future-proofing is speculative until it protects a present promise or a documented constraint. Decide what evidence would make the deferred option worthwhile. YAGNI stands for you aren't gonna need it. It comes from Extreme Programming. Ron Jeffries put it like this in 1998: always implement things when you actually need them, never when you just foresee that you need them. Guesses are often wrong. Then the work is lost. But even a right guess costs: something else was not built in that time, and everybody has to work around the new code until it is used. 00:01:26 Build the payment that exists The requirements ask for card payments today. A proposed plugin marketplace would solve imaginary integrations before a second provider exists. Implement the observed card flow and its failure cases. Keep the charge operation small enough to test, without a plugin loader. When a bank transfer actually arrives, compare the two real contracts. One completes immediately; the other may stay pending. That evidence gives you a better abstraction. A card-only checkout must record approval and decline today. Simulate a decline and ensure the order stays unpaid. A new gift-card interface does nothing to improve that observed result. A future second payment method can reveal which inputs are actually common. 00:02:14 Distinguish foresight from speculation A booking service already promises never to allocate one seat twice. Atomic reservation protects a current requirement and cannot be postponed as speculative engineering. A configurable recommendation engine that no caller uses can wait. Remove the speculative extension, but try two current customers buying the last item at once. That requirement already exists and its failure would oversell real stock. Deferring a hypothetical payment type and enforcing an actual invariant are compatible choices. Leaving out recovery that a documented durability promise requires is a defect, even if most demos never crash. When two genuine providers arrive, compare their actual outcomes before extracting a common interface. Python considered a switch statement long before structural pattern matching shipped. The eventual design covered a richer set of cases than the early proposal. That history illustrates a practical risk: a speculative interface can freeze the wrong model. Capture the user stories that matter now and keep enough room to change when further examples arrive. 00:03:22 Try an interview follow-up A director wants the new system to be ready for ten times the load. What do you say? I ask for the date and the evidence. Then I separate: what is a one-way door, such as how data is keyed, gets thought now. What can be added in weeks, such as caches and more machines, gets a trigger and a load test. I show the cost of both in weeks of product work, and we decide openly. A team wants regional inventory plugins before opening its first warehouse. What requirement would justify the extra boundary today? Implement reservation and cancellation for one warehouse and keep the stock invariant in one place. When regional allocation arrives, the working tests will reveal which behavior needs to vary. 00:04:16 What to take with you Build what is needed now. A guess costs when it is wrong, and it also costs when it is right: build, delay, carry, repair. YAGNI works only if later is cheap. So tests, clear names and small parts are never optional.