3 ms·
There are in-band and out-of-band ways of communicating information that matters to your collaborators (including future-you) but not to the compiler. Commit m
by kbolino 3y ago
There are in-band and out-of-band ways of communicating information that matters to your collaborators (including future-you) but not to the compiler.
Commit messages (out-of-band) tie this information to the specific time when the change was made. They also don't clutter the code up.
Comments (in-band) tie this information to the specific place where the change was made. If overused, they make the code harder to read.
Commits can get lost in the noise, though blame and bisect can help find them. Comments can get stale and cause more confusion than assistance.
Honestly, if we spent more time reviewing and revising each other's code than just writing it, then comments (combined with refactoring for readability) would probably be the better solution. But that would slow down development. If you're going fast or lean, then relying on commit messages is better than nothing at all or fired-and-forgotten comments.