2 ms·
If you have never needed to find out why a particular piece of code is the way it is, then you have been very lucky to work in very clean code bases. In my own
by tsimionescu 4y ago
If you have never needed to find out why a particular piece of code is the way it is, then you have been very lucky to work in very clean code bases. In my own experience, this has been an infrequent but inevitable part of work - maybe once a month or so, I have had to understand whether a particular piece of code, that seems wrong, had a good reason for existing or not.
Sometimes it turned out to be a mistake in the original commit, or working around a limitation that no longer exists, other times it has saved me from re-introducing a bug that someone had spent effort fixing.
- kazinator 4y agoArrayBoundCheck didn't say they never had to find out why a particular piece of code is the way it is, just that they didn't have to search through log messages. For isntance, when you use "git blame" and similar tools, the log messages are not involved. You might end up reading the log message of the commit that was responsible for a change, but you didn't search log messages to get there. In a project with poor commit messages, they will be of little use; reading them won't produce much value, let a lone searching. Anyway, that seems like the best possible interpretation of the user's comment, anyway.
- yencabulator 4y agotsimionescu didn't say anything about searching the logs. The commit message explains (/should explain) why the commit was made. That is useful even if you arrive at the commit via git blame, bisect, etc.