5 ms·
OK, but at the same time by automatically dismissing a YAGNI objection as a "thought-terminating cliché" you'll end up with different sorts of ridiculous shit.
by mrec 10y ago
OK, but at the same time by automatically dismissing a YAGNI objection as a "thought-terminating cliché" you'll end up with different sorts of ridiculous shit.
IME, the YAGNI principle is most useful with new-ish developers who've been taught certain patterns but haven't grasped the motivation for them and so can't judge when the overhead is worth it. In Java-land we'd be talking about the old every-class-must-implement-an-interface-and-come-from-a-factory clichés. It's not that it's a bad pattern, just that until you have multiple implementations and/or a need for DI it probably isn't worth the source bloat.
In that situation I think YAGNI is exactly the right objection, and I'm not sure what would take its place if it became widely Considered Harmful.
- CarpetBench 10y agoSorry, I should've clarified - I'm not opposed to the principle, in moderation of course. You're hitting on places where it is quite useful. It's incredibly mind-numbing when it's being used to justify laziness and short-sightedness. Worse, it's not exactly a misuse of the phrase, as per the original XP article: > Always implement things when you actually need them Security is, as an example, one of those things where you'd face a disaster if you just implemented it when you actually needed it (i.e. when an attack occurred). YAGNI is incredibly short-sighted in situations where rectifying the situation later will be an absolute nightmare (or just impossible). An ounce of prevention is worth a pound of cure, and all that.