Programming Concepts
Check your understanding - Comments
What are comments for?
Comments are used by the program to determine which parts of the code need to be actioned
No, comments are ignored by the program.
Comments describe what each line in the program does
It would be unusual to comment every line in a program. If good variable and constant names are used, the code is usually self-explanatory.
Comments contain text that can be used by the program
No, comments are ignored by the program.
Comments are used by programmers to hide code from the program
When a program is being tested and debugged, a programmer will sometimes comment out lines of the program to help determine where the bug is. However, this is not the main purpose of comments.
Comments describe what a section of code does at a high level.
Yes. Comments put the code they relate to into the context of the aim of the program, by describing what the code does rather than how it does it.
← Previous
1
2
3
4
5
6
7
8
9
10
11
12
Next →