WorksheetsComments documentation coding
Total questions: 8
Worksheet time: 5mins
// Why add comments to code?
// more than one is true!
retain the code tips for yourself
explain code to others
disable code for a moment of problem solving
All true:
Syntax: Leave a comment in code by starting the line with _____
//
blanks
indent
$
Programmers use comments to:
debug issues in code
document how code was written for other programmers to use
decide which components are important to use
An advantage to using comments in your code is:
It makes your code run better
It runs the code in slow motion, step by step
it describes parts of your code so others can understand it or improve it
comments are necessary in order to call a function
Comments show the exact location of bugs.
Comments are optional
Comments can disable code temporarily.
// comment
var x = 0;
Form of program documentation written into the program to be read by people.
Comment
Documentation
Input
Output
What did the grey hair person put in their code?
This explains the finished project.
The answer is: comments
(a)
Giving variables clear names creates code that documents what is happening and helps other programmers understand your code
False
True
Decoy
do not click me
