Comment by rkomorn
But... I keep being told that commit messages are useless because the code is the documentation, so code diffs are self-explanatory...
But... I keep being told that commit messages are useless because the code is the documentation, so code diffs are self-explanatory...
That only works if the code is good enough to be the documentation. In DayJob prefer to cover all the bases:
∞ Try make the code sensible & readable so it can be the documentation.
∞ Comment well anyway, just in case it isn't as obvious to the reader (which might be me in a few months time) as it is to me when making the change. Excess comments can always be removed later (and, unless some idiot rewrites history, can potentially be referred to after removal if you have a “why t f” moment), comments you never write can't be found later.
∞ Either a directly meaningful commit message, or at very least ticket references to where more details can be found.
For personal tinkering, I'm a lot less fastidious.