3 ms·
“Do not duplicate your code” rarely improves readability, unless the part that you dedupe is a simple semantic component of its own and not closely intertwined
by ummonk 8y ago
“Do not duplicate your code” rarely improves readability, unless the part that you dedupe is a simple semantic component of its own and not closely intertwined with the nonduplicated code it is embedded in. More often, it can lead to the hidden trap of abstractions mentioned in the OP’a post.
The primary reason to avoid code duplication is to improve maintainability and refactorability, not to improve readability.