2 ms·
Well, yes, it's true that there's a trade-off, but the "DRY principle" is justified by the other side of that trade-off. And that side becomes stronger with eve
by einpoklum 6y ago
Well, yes, it's true that there's a trade-off, but the "DRY principle" is justified by the other side of that trade-off. And that side becomes stronger with every repetition of your code.
Also, some of the negatives of not-repeating-yourself are not general:
* Often your repetitions themselves are localized.
* Sometimes, you can generalize your code even _more_, to factor out the non-general parts, so that you end up with a generalization of the scheme/mechanism, applied with specific details.
* You can limit your DRY to within your scope of ownership, i.e. have module-local / unit-local utility constructs. Then, only if you agree with others on the generalization, do yu surrender ownership.
etc.