3 ms·
>Am I the only person that this is regression? How can code-duplication be defended by 'simplicity'? Easily. People can avoid code-duplication in many ways, an
by coldtea 7y ago
>Am I the only person that this is regression? How can code-duplication be defended by 'simplicity'?
Easily. People can avoid code-duplication in many ways, and some of them are harmful.
E.g. by building abstractions that get out of hand and add mental burden to track the program flow and bugs.
Or by making any small piece of code into a standalone 2-3 line function, so that anything always happens elsewhere, and keeping track of flow is made difficult.
Or by prematurely putting code into a function when it's just used in 2-3 places, and then when another need arises that doesn't fit in to the already captured function, hacking the function to handle different behaviour on different arguments/flags and ending up with monstrosities.