2 ms·
Disagree. You should never "prefer" one over the other without considering and understanding the actual line where the decision becomes non-obvious. The author
by fragsworth 10y ago
Disagree. You should never "prefer" one over the other without considering and understanding the actual line where the decision becomes non-obvious.
The author is missing a major important factor, that it entirely depends on the size/scope of the duplication, and the size/scope of the changes necessary for functionality.
More lines/complexity that won't change means you should be more likely to want to abstract it. More changes to the code means you should be more likely to want to duplicate it.