jargon

Comparison

Rule of threevsYAGNI

Rule of three

you copied the block a second time and left it alone, and only pulled it out on the third.

Wait until you have three cases before abstracting over them. Two examples are not enough to see which parts genuinely vary, and an abstraction built on two is usually the wrong shape, which is worse than duplication because it must be unpicked before it can be fixed. It is the practical middle between religiously removing duplication and never noticing it.

Full entry →

YAGNI

you built the plugin system for the second provider, and two years later there is still only one provider.

The rule that you do not build a capability until you actually need it. It is not an argument against thinking ahead; it is an argument against paying now for a guess, because the guessed-at flexibility is usually the wrong shape when the real requirement arrives and has to be removed first. The cost is compounding: the speculative abstraction is carried, tested, documented and worked around by everyone in the meantime.

Full entry →

Related comparisons