4 ms·
I am firmly in the DRY camp, although obviously there are limits to how far you should go to maintain the dry-purity. In my experience, the biggest issue with c
by svantana 10y ago
I am firmly in the DRY camp, although obviously there are limits to how far you should go to maintain the dry-purity.
In my experience, the biggest issue with copy-pasting code is that someone else (or your future self) will edit the code in only one of the places, making the codebase inconsistent. If abstraction gets too costly, I have found it useful to simply add a comment in both places, "copied from x" and "pasted from y" respectively. Or, if there are constants involved, break those out as global constants.