3 ms·
Yeah, I hate comments at the end of a line of code. No good can ever come from having a comment on the same line as code, it only encourages completely meaningl
by amag 11y ago
Yeah, I hate comments at the end of a line of code. No good can ever come from having a comment on the same line as code, it only encourages completely meaningless comments like:
int a = 0; /* assign 0 to a */
a += 5; /* add 5 to a */
Until you realize that you were really meant to add 6 to a and change the code and not the comment.
Comments should be written on their own line(s) and only to explain the intention or warn against uninformed changes (or both):
// WARNING! There be dragons here. It *may* look like we're reading
// uninitialized memory here but it's all part of a greater plan,
// the plan to get some good entropy into the random pool. So don't
// remove the reads you don't understand, even if lint tells you
// they're bad or you'll severely limit the entropy of all users
// private keys from now on.