3 ms·
However 10 years later, it is also likely you'll be reading the comments for the explanation and realise that what the comments say is different from what the c
by imron 11y ago
However 10 years later, it is also likely you'll be reading the comments for the explanation and realise that what the comments say is different from what the code does (because over the span of 10 years the code was updated but not the comments) and that's just as confusing.
If the code is written with meaningful variable and function names, and functions no larger than a screen, then lack of comments isn't really a problem.
- yoklov 11y agoYep, and often the code that breaks what the comment says is far away. Too easy to change something that subtly invalidates a comment in some other module. Especially if you didn't write that module.
- mannykannot 11y agoIt is also possible that your change subtly invalidates the semantics implied by the identifiers used in some other module. In either case, there is a nontrivial possibility that you have introduced a bug (and quite possibly a subtle one).
- mannykannot 11y agoVariable and function names can be just as misleading as comments. I am not aware of any language which guarantees the semantics implied by your choice of identifiers.