4 ms·
> Deduplicating code ends up coupling together code paths that are entirely unrelated, which ends up increasing the complexity Code paths that may be unrelated
by mcv 3y ago
> Deduplicating code ends up coupling together code paths that are entirely unrelated, which ends up increasing the complexity
Code paths that may be unrelated. If they are related, then deduplicating is most definitely a good idea. If they're trying to do the same thing, it makes sense that they call the same function to do it. If they do completely different things that currently happen to involve some of the same lines of code, but they could become different in the future, then deduplication makes no sense.