Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


It 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.


Isn't that very close to the suggested solution - which is inlining the correct "duplicate" code that's necessary to solve the problem?


s/his/her




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: