loading...

re: 4 practices for better code VIEW POST

TOP OF THREAD FULL DISCUSSION
re: i disagree, comments usually lie . See code get updated all the time but there is no restriction on comments so it can mislead you . i think you ...
 

explaining an algorithm

Precisely.

I think he's saying don't add comments on every single line.

/// Gets the last item index used in the current state.
size_t getLastIndex() {
    [...]
    // Returns the last index.
    return lastIndex;
}

The doc comment at the top of the function already says what the last line if the function body is, yet I see things like this all the time.

code of conduct - report abuse