Comments – leaving yourself notes or reminders
Comments are a great way to create notes or reminders to yourself. When you comment code, it means that it will not be executed when your code runs. There are two types of comments used //
or /* */. //
is typically used for a one-line comment and /**/
is used for a block of text.
You can add comments to your code, such as a TODO
item or just a brief explanation of what something is doing.
Let's see what both of these look like:
Get iOS 10 Programming for Beginners now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.