Line: | Intro Line | Type: | Walkthrough |
You should have completed: | Hello World | This topic leads to: | Counting Up |
All programs can benefit from comments. Comments can be used to record any information you like. They are ignored by the compiler and do not affect the function of the program at all.
They are a vital tool in the programmer's arsenal, however, often used to:
// Author: [Your Name Here]
// SID: [Your SID]
// Edited: [Today's Date]
The code is functionally unchanged, but important information has been added. Should another person have a problem or query about this code, they can now tell who wrote it and when, and therefore who to ask. By convention, comments usually appear before the line(s) of code that they refer to.
You should include these comments in every code file you create.
There should be no change in what happens when you do so.
The program behaviour has been altered as we have told the compiler that that line 'should be ignored'.