Hacker News new | ask | show | jobs
by pytester 2348 days ago
YAGNI is about not adding functionality until it's needed. DRYing code isn't adding functionality.
3 comments

I think GP is implying the thing you're not going to need is a generic solution to the repetition. i.e: DRY is in fact a feature.
DRYing existing code to handle exactly what is needed to support the current uses with no additional axes of variation isn't adding functionality (well, if it handles more than the existing values in the existing axes of variation, it's adding some but arguably de minimis functionality.)

Building code with support for currently-unused variation to support expected future similar-but-not-identical needs, that is, pre-emptively DRYing future code, is adding functionality.

WET - Write Everything Twice