Do use comments wisely. Do not overuse it by writing comments for every line of code
Do place the comment on separate line, not at the end of a line code
// A base price should not be less than zero
var basePrice = 1000
Do begin a comment text with Uppercase letter, and insert a space after the comment delimiter (
//)
// This is a comment
Do use
TODOcomments for the things that need attention for future improvements
Note: TODO comments should not be used to run away from a problem forever. Ideally every TODO items
should be tracked and linked to a card/task/issue in the project’s task tracking tool.
// TODO: this is a naive implementation, let's find a way to optimize it in the future