I really like your thought process on this. Though I just want to make sure I understand you correctly: Are you saying that YAGNI is not a reasonable argument against clean code techniques like the never/exhaustiveness checking I showed above?
If so, I agree with you because it helps to keep the codebase clean, and as you said:
A clean codebase is the ultimate defence kit against these costs.
“Yagni only applies to capabilities built into the software to support a presumptive feature, it does not apply to effort to make the software easier to modify.”
I really like your thought process on this. Though I just want to make sure I understand you correctly: Are you saying that YAGNI is not a reasonable argument against clean code techniques like the never/exhaustiveness checking I showed above?
If so, I agree with you because it helps to keep the codebase clean, and as you said:
Well put. :)
Yes. As Martin Fowler puts it:
“Yagni only applies to capabilities built into the software to support a presumptive feature, it does not apply to effort to make the software easier to modify.”
Wow. That’s an incredible quote. Thank you so much for making me aware of it. :)
Here’s the reference along with a discussion of the cost considerations behind YAGNI
martinfowler.com/bliki/Yagni.html