Writing lots of lines of code and you're worried you might not understand your code next week?
Want to make your project understandable to other programmers?
Comments are the way to go about it. A comment is a programmer-readable explanation or annotation in the source code of a computer program.
Comments are added to make the source code easier for humans to understand and are generally ignored by compilers and interpreters.
Comments are started with a language-specific symbol
<!--This is a comment -->
/* This is a comment */
//This is a comment
When to use comments
"A handy rule of thumb is: a comment should only be added to answer a question that the code can't. If you aren't confused by what a piece of code is doing, but rather why it's doing it at that moment, then a comment should be added." - Mark Cronin
Comments can be placed wherever white space is allowed within a style sheet. They can be used on a single line, or traverse multiple lines. This allows commenting inside a block of code and between a group of codes. What matters is making your code glanceable.
/* A one-line comment */ /* A comment which stretches over several lines */
The /* */ comment syntax is used for both single and multiline comments. There is no other way to specify comments in external style sheets.