|
|
|
|
|
by quietbritishjim
1302 days ago
|
|
> If you don’t fix it… and the code is working… what is the problem? Two obvious problems: (1) more likely future bugs; (2) wasted time Often "fix it later" means "de-duplicate this copy and pasted code later", where the copy is slightly different so there's some refactoring required to do that. The future bugs come from changing one copy but forgetting to change the other. Sounds unlikely but very common in practice. The wasted time comes from having to redundantly update both (or several!) copies. That's more work than it sounds because you have to understand the subtle differences in each, whereas if you had refactored them into one code base then the differences would be some obvious function/class/etc. Of course, each time, this update to all the copies is less effort than doing the refactoring, so the wasted time builds up gradually over time. |
|