Comparison
Premature abstractionvsYAGNI
Premature abstraction
there is an interface with one implementation and a config flag that has never been anything but its default.
Building a general mechanism before there is a second case to generalise from, so the abstraction encodes a guess about which axis will vary. It is worse than duplication because the wrong abstraction is harder to undo — every caller now depends on its shape, so removing it is a change to all of them. Sandi Metz's formulation is the one to remember: prefer duplication over the wrong abstraction.
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 →