2 ms·
Like with many things it's a balance. If you have to spend too much time thinking about how to create a more reusable or deduplicated version of something, it's
by Jtsummers 5y ago
Like with many things it's a balance. If you have to spend too much time thinking about how to create a more reusable or deduplicated version of something, it's probably not ready to be deduplicated. On the other hand, I've watched several projects flounder because of useless duplication:
main.cpp
complex_baseline/*.{cpp,h}
copy_and_mod_1/*.{cpp,h}
copy_and_mod_2/*.{cpp,h}
... (about 12 times)
The duplication means that issues are scattered throughout every copy if they're in the original, but hard to find after the modifications. Doing the exercise to find all the duplicated issues is frustrating and people eventually stop doing it. The code gets worse and worse until a refactor or rewrite is forced on them, and then the customer is unhappy with the delay and it's either hastily done (often worse than doing nothing) or abandoned.