3 ms·
I once fixed a bug like that, then went wait a minute. Sure enough source control revealed I'd made exactly the same fix 2 years ago, and 2 years before that so
by bluGill 6y ago
I once fixed a bug like that, then went wait a minute. Sure enough source control revealed I'd made exactly the same fix 2 years ago, and 2 years before that someone else had done exactly the same. In the odd years someone else undid that fix to fix a different bug that seemed unrelated. Once I figured out what the other problem was I was able to find the more complex fix for both situations.
I wished I had heard of automated tests then
- smileypete 6y agoMaybe add a dated note as a code comment breifly describing the reason for the change.
- magicalhippo 6y agoYeah I always check source control (blame/annotate), even if I wrote the code myself, just to be sure I'm not missing some context. Automated tests is pretty great, but a lot of the stuff we do is difficult to test, mostly due to a lot of legacy code that's not well confined. As we work on a piece of code we try to clean that part up, but it takes time.