The why behind code
You’re debugging something and come across unfamiliar code. It’s doing some things that don’t make sense and could potentially be the source of the bug, but you aren’t sure.
This happens a lot with old codebases. Why was it written this way? It isn’t always apparent.
Using version control, you can look up when the file or even lines within it were last changed. When they first appeared. Sometimes for very old code, it’s been branched and merged and integrated without changes, so it can be quite the task to find out when it truly first appeared.
Once you know when it first appeared, it can further prove or disprove relation to the current bug. You’ll also have any commit messages written and the original author name. Sometimes the author won’t be available to ask for more information, but you might be able to narrow down material in other documentation or ticketing systems.
There is a “why” behind code, and it’s not always apparent or accessible. Finding it will help your debugging efforts.