34 ms·
Comments may drift if the code is not maintained properly, but commit messages will also drift. The more you edit/move/refactor, the harder it will be to connec
by olavk 8y ago
Comments may drift if the code is not maintained properly, but commit messages will also drift. The more you edit/move/refactor, the harder it will be to connect the code in question with the relevant commit message. I don't believe good tools will save you here - the more changes happen to the code, the harder it will be to find the relevant commit message which explains the code.
Comments you can at least make an effort to keep up to date. Especially if have a policy that all comments should actually be relevant.
Comments shouldn't be obvious and unnecessary. They should explain things which cannot be inferred from the code itself, eg,
// have to call reset() twice here because the XZW API has a bug which restarts the server if reset is not called twice. See ...