3 ms·
Because the multiple instances are concrete while the unified code is abstract. In general it is more difficult to read abstract code than concrete code. Also
by amelius 6y ago
Because the multiple instances are concrete while the unified code is abstract.
In general it is more difficult to read abstract code than concrete code.
Also code written using the wrong abstaction can get hairy very quickly (lots of "if" statements for various cases).
- fiddlerwoaroof 6y agoIn Java, when I hit a bad abstraction, I hit the inline shortcut (command-alt-n) and then evaluate the resulting code with git diff. Other languages may be more manual, but, at worst, you just use ripgrep or similar to find all the relevant use sites and then manually expand the abstraction: this is only really a problem it the function is used hundreds of time: but, in that case, you can always duplicate the abstraction and rename.