Hacker News new | ask | show | jobs
by yellowbanana 1780 days ago
For me the most helpful general guideline has been. Make the code easy to change.

I can break rules like DRY, if the repeating myself makes it easy to change.

2 comments

Yes, I often feel like 'refactorability' is way undervalued. The focus is on writing abstractions that can be easily extended to handle more cases but as soon as some case doesn't fit, it will be hacked in because the code is abstracted in a very narrow way and cannot be easily refactored to accommodate this new case 'natively'.

Do that for a couple of years in a single codebase and the beautiful abstraction design has changed into a state machine with a transition between almost every pair of states

Yep, modularity is immensely valuable. Requirements change. Technology changes.