Comments
The sample program you wrote is a very simple example of code—there is nothing complicated going on. However, a real-life program is normally more complicated and lives a longer life than a sample program in a book for learning programming. The people developing these programs have realized very early that a mechanism to add notes and comments about what certain pieces of code do is an absolute must—from the human perspective. These comments are required as an additional explanation for what a given piece of code does. They are useful to somebody who uses the code to extend (improve) it or is just reading it trying to understand what different parts of it are doing, or as input for a documentation generation tool.
In programming, these ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access