Comments
Comments Explain Why, Not What
// Check if the player exists
if (player == null) {
return;
} Useful comments explain things such as protocol constraints, workarounds, external bugs, non-obvious mathematical behavior, or unusual performance constraints.
Code should explain what happens. Comments should explain why something unusual is necessary.