4 ms·
Ok, but how much time have you "wasted" wondering what a piece of code was doing versus how much time would you have wasted writing good commit messages?
by amelius 7y ago
Ok, but how much time have you "wasted" wondering what a piece of code was doing versus how much time would you have wasted writing good commit messages?
- deanmoriarty 7y agoIt has been an obvious net time gain for my projects. I do a lot of system programming, and often there are very complex reasons why a particular function is called in a non-obvious way, especially after tricky bugfixes. Having a somewhat detailed written record associated with the commit, that won't rot like an inline code comment would, has been very useful in my experience. And all my thoughts become instantly available to all the future code readers, who will most likely not be me.
- ses1984 7y ago>that won't rot like an inline code comment would It's a balance between rot and visibility, right? Unless you code with commit messages always visible, you have to go out of your way to look at them. If the interesting line changes even a little bit, you could hide the commit message explaining everything with one that explains a small change. If I could only have one, I would rather have comments visible in the code, and control they rot through change review, but of course finding a balance between both is the best.
- saagarjha 7y ago> Unless you code with commit messages always visible I do this when tracking down bugs or trying to figure out the design of a particular component.
- pjc50 7y agoI can see what the code is doing. I can't necessarily see why it's doing that and whether it's a bug or a feature. Good messages make ""blame"" extremely useful. It was a constant source of irritation at a previous job where the repository had been imported from a different version control system without history. So half the time "svn blame" would just tell you it was in commit #1 ten years ago, which wasn't nearly enough.
- nogabebop23 7y ago>> I can see what the code is doing. I don't think the reader should have to look at the code to get the summary of what the code does and how it does it. I agree that the "why" should be the focus.
- nogabebop23 7y ago>> how much time would you have wasted writing good commit messages? or time wasted writing unit tests, or pull requests, or code reviews? (1) It's about effective communication. Why do developers appear to care so much about the way we write our code but not the artifacts that form it's ecosystem (and have a much wider audience)? (2) If you're going to write a commit message, why not take the incrementally very tiny extra bit of time to do it right? If you don't really care about the quality of your commit messages I'd suggest stop requiring them and allow blank commits. IMO this is preferable over the false impression that a garabage commit history provides any value.
- dtech 7y agoIt's a balance, but I've definitely seen that a good commit title can massively help newcomers, yourself when you can't remember why something is the way it is and can be a boon when debugging. A nice balance I've found is to not care while developing, but then squash all commits into a single one when merging a pull request and give that a good message.
- katbyte 7y agoThis is what I do, means I don’t have to worry about describing a “fix linting errors” commit. Just on squash merge ensure the commit message captures what’s required (and on gh the pr is automatically included and I typically put any linked issues in the additional info area)
- 0xEFF 7y agoIt's not wasted, sloppy commit messages are correlated with sloppy code. Thinking through describing the change in prose has an immediate positive impact on code quality.
- nemetroid 7y agoFor me it's definitely in the first category, and I take my time writing good commit messages. It also serves as a good filter for commit content. If you can't write a good, comprehensive commit message for it, it probably shouldn't be its own commit.