3 ms·
Yes, exactly! I think people follow the principle blindly and try and pull out code that happens to be the same in two places. But if you anticipate that they m
by barbs 8y ago
Yes, exactly! I think people follow the principle blindly and try and pull out code that happens to be the same in two places. But if you anticipate that they might change in the future it's sort of a meaningless abstraction that doesn't give much benefit and just complicates the code.
I think it's important to realise that these principles are good in general, but you can have too much of a good thing, and there are trade-offs involved as you take them more and more to the extreme. I can't say I'm an expert so I may be wrong about this, but it seems like you really need to get a sense of what's needed in each scenario - how should this bit of code work and is this communicated effectively? I find this takes practise to gain a "feel" for, but then that feels less teachable than simple principles.