2 ms·
Yes!! Very true!! I would add that even if the introduced abstraction is NOT "wrong", adding more abstractions has its own cost in terms of readability, underst
by alexdowad 11y ago
Yes!! Very true!! I would add that even if the introduced abstraction is NOT "wrong", adding more abstractions has its own cost in terms of readability, understandability, navigatibility, etc. of the code. Even if the abstraction is not "wrong", adding a new abstraction to remove 10 lines of duplicated code is not always a good tradeoff!
Abstracting out details so the "big picture" becomes clearer can make code more understandable. At the same time, more abstractions means more "layers", which a reader has to dig through to find out what is actually going on, making code less understandable. So there is a tension between allowing duplication, and removing it by adding a new abstraction, and which choice is better depends entirely on the specific situation.