3 ms·
I mean, yes and no, and aside from that - the article isn't even about regressions. > embeds decisions and solutions that may not be evident to anyone just rea
by RangerScience 3y ago
I mean, yes and no, and aside from that - the article isn't even about regressions.
> embeds decisions and solutions that may not be evident to anyone just reading the code.
Strongly agree! Good code communicates this to other programmers (including yourself in 3-6 months). If the code doesn't do a good job of this, that alone can not only be worth a refactor, and when you refactor while "what it took to understand what this does" is fresh in your mind, you can write the new version that much more effective at communicating those learnings.
- somewhereoutth 3y agoHowever that requires your learnings to be complete (in respect of the code you are rewriting). My point is that for any reasonably complex code base of some age, that may not actually be possible even with the best of intentions. There will be a corner case you'll miss, or a necessary optimization you'll leave out. Of course this is over a spectrum, so refactoring code that only you wrote quite recently is probably ok and indeed a good thing!