2 ms·
>> If the reason for the duplicated code is just coincidence, Totally agree! However, if code is duplicated because there is some is some assumption of functi
by georgeecollins 5y ago
>> If the reason for the duplicated code is just coincidence,
Totally agree! However, if code is duplicated because there is some is some assumption of functionality that is represented in multiple places then it gets more iffy. I took this article to imply that in each function implementation there were something like similar calls to a library or particular orders of redrawing based on the way the code base worked. That's where it can get dangerous.
It's not as dangerous if there are four very similar functions sitting right next to each other. But if there is a block of code that implements a way of working and another block of code has the same implementation in a place that isn't as easy to find that seems dangerous to me. If you want to make one change to a code base ideally you make the change in one place.