3 ms·
When you find yourself at his step 8 you don’t necessarily have to go back and fix all the sins of the past. There’s a cost to this which may or may not make se
by jmull 8y ago
When you find yourself at his step 8 you don’t necessarily have to go back and fix all the sins of the past. There’s a cost to this which may or may not make sense to pay. You could simply not use the bad abstraction.
- elbasti 8y agos/his/her
- pavel_lishin 8y agoIsn't that very close to the suggested solution - which is inlining the correct "duplicate" code that's necessary to solve the problem?
- strken 8y agoIt should also be pointed out that when you find yourself at steps 6 and 7 you don't have to sin, and when you find yourself at step 1, you can obey more complicated heuristics than DRY, like "I will apply the rule of three if the duplicated code is pretty short and not inherently self-contained" or "if this big method looks like it will change, instead of fully abstracting it, I'll just break out the bits that look like neat little functions". You only find yourself at step 8 after a suite of bad decisions, and possibly even bad decisions that you signed off on during code review.