Good Commenting Practice
I just read this article on stack overflow and summarized it (so you don't have to):
1. Do not duplicate what your code is doing. On a similar note, do not comment every single line of your code.
2. Do not provide information that should be given by the code. For example, do not use comments to explain what a variable holds if you can't tell simply by looking at the variable name (just use better variable names.
3. If you can't write a clear comment for a piece of code, then there is either a problem with the code or you don't understand what exactly the code is doing.
4. Make sure your comments clear up confusion caused by the code, not amplify it.
5. Use comments to explain code that may seem extra or redundant to someone else reading that code, but is necessary.
6. If you copy code from somewhere else, make sure to include exactly what the code does and where it was copied from (even better if you include URL).
7. If helpful, then include links to external references.
8. Add comments when fixing bugs. Include what the bug was and how it was fixed.
9. Use TODO to mark places where code is still incomplete.
While there are many resources to help programmers write better code—such as books and static analyzers—there are few for writing better com











