3 ms·
Sure but every line? You increment a loop counter, i+=1; and you say that in a comment? The best rule of thumb is, make the code so clear that it is itself a c
by hellofunk 8y ago
Sure but every line? You increment a loop counter, i+=1; and you say that in a comment?
The best rule of thumb is, make the code so clear that it is itself a comment, and only if the code cannot relay the meaning, then add a comment.
- injvstice 8y agoDepending on the code, it can be freaking hard to track down what that 'i' means, especially when someone writes a coding standard (or a language) where it requires all variables to be defined at the beginning of the function instead of close to location of use. on the other hand, if it was named something like number_of_records it would be clearer.