Comments
Imagine if you were building a chair or something from IKEA and the instructions didn't have anything on them. The pure agony and misery you'd feel is the same feeling people get when they see a code without any comments (this is from experience).
Comments are little notes that the coder writes so that people who look through the code understand what's happening. Whatever's inside them will not be checked by the compiler for errors. You can literally put the entirety of the Bee Movie script into a comment and your code would work fine.
There are two types of comments that we use: single-line and multiline comments.
// single line comment
/* multi
* line
* comment */
For most cases both comments work fine. However, there are two style rules that we follow to keep our life expectancy up:
Put comments in parts of your code that look confusing.
If a comment ends up being too long (200 > characters long), move the rest of the comment onto a new one below.
Comment method/class headers. When you do, use multiline comments, but with an extra asterisk (*) at the /* part. Due to VSC Quality of Life additions, this gives a little tooltip when you hover over the method header!

Last updated