3 ms·
Depends. I haven’t come up with the rubric yet but it’s something like “don't abstract out functionality across data types”. I see this all the time: “I did thi
by dclowd9901 3y ago
Depends. I haven’t come up with the rubric yet but it’s something like “don't abstract out functionality across data types”. I see this all the time: “I did this one thing here with data type A, and I’m doing something similar with data type B; let’s just create some abstraction for both of them!” Invariably it ends up collapsing, and if the whole program is constructed this way, it becomes monstrous to untangle, like exponentially complicated on the order of abstractions. I think it’s just a breathtaking misunderstanding of what DRY means. It’s not literally “don’t repeat yourself”. It’s “encapsulate behaviors that you need to synchronize.”
Also, limit your abstractions’ external knowledge to zero.
- tasuki 3y agoVery good explanation! > “I did this one thing here with data type A, and I’m doing something similar with data type B; let’s just create some abstraction for both of them!” I'm guilty of this. I even fought hard against the people who wanted to keep the code duplicated for the different data types. > “encapsulate behaviors that you need to synchronize.” I like that!