3 ms·
Yea, there are many schools of thought on what/how to comment "properly". But I have found this simple rule to cover most of the cases, it's not perfect but bet
by rawoke083600 6y ago
Yea, there are many schools of thought on what/how to comment "properly". But I have found this simple rule to cover most of the cases, it's not perfect but better than most:
"The code is the HOW, the comments are the WHY"
- TeMPOraL 6y agoThat's a good rule of thumb. Personally, I also add comments for the HOWs that may be relevant to users of a function/class, that cannot be easily expressed in code in the function signature or class declaration. Things like, "relative ordering of results is not preserved", or "this function is O(n^3)".