4 ms·
> Commit messages are a poor place to document code because they don't stay with the code. They actually do stay with the code only as long as the code is pres
by u801e 8y ago
> Commit messages are a poor place to document code because they don't stay with the code.
They actually do stay with the code only as long as the code is present in the code base. The code can be updated independently of its associated comment, but the associated commit message will change.
- detaro 8y agoThey stay with the code as long as the code is absolutely untouched, which often is a lot shorter than a comment about code remains relevant. Code gets moved, reformatted, ... without details about it becoming stale.
- int_19h 8y agoUnless you have large chunks of code moved around wholesale, you can usually track all commits that touched a particular line of code. I've done that while debugging codebases that were over a decade old. And seeing those commits was incredibly helpful, despite the code itself being heavily commented.