8 ms·
The rule of three[1] also comes to mind and is a hard learned lesson. My brain has a tendency to desire refactoring when I see two similar functions, I want to
by zendist 2y ago
The rule of three[1] also comes to mind and is a hard learned lesson.
My brain has a tendency to desire refactoring when I see two similar functions, I want to refactor--it's almost always a bad idea. More often than not, I later find out that the premature refactoring would've forced me to split the functions again.
1: https://en.m.wikipedia.org/wiki/Rule_of_three_(computer_programming) https://en.m.wikipedia.org/wiki/Rule_of_three_(computer_prog...
- swader999 2y agoNice, I advocate for this but never new it was a more formal thing.
- kitkat_new 2y agobetter understand DRY first, before you add lots of technical debt to your code: https://news.ycombinator.com/item?id=40525064#40525690 https://news.ycombinator.com/item?id=40525064#40525690