top | item 43469066

(no title)

naavis | 11 months ago

They are incredibly helpful when you are trying to find where a bug was introduced, and trying to figure out why some piece of code is the way it is.

discuss

order

tobyhinloopen|11 months ago

If you can’t figure it out based on the git blame and git diff, the code is incredibly unreadable. A comment in the code, or simply writing better readable code seems like a better investment.

Besides, a few passes refactoring and your git history is ruined. No way you’ll find the original commit within any reasonable time frame.

If I move the code to another function, your original commit message will be hard to trace. If the code was commented, the comment would have been moved along. If the code was readable, you don’t need the comment or the commit message.

naavis|11 months ago

I can only speak from my own experiences, but I have found commit messages extremely helpful, when they explain the "why" of the change. And as unfortunate as it is, many of us also have to work with unreadable codebases.