(1) Do the CodeHS lesson on commenting and answer these questions in OneNote
- What is a code comment?
- What are the pre and post conditions for the runToFinish function?
- Add useful comments with pre and post conditions to this code
function start(){
move3();
get3();
move3();
get3();
move3();
}
function move3(){
move();
move();
move();
}
function get3(){
takeBall();
takeBall();
takeBall();
}
Answer the questions in your OneNote notebook about the article: the Good, Bad and Ugly about commenting code.
- Look up a definition for API and put it in your own words here:
- Does the author say that commenting code is a good thing to do? Why or why not?
- What is a downside to documentation comments?
- What is the purpose of a clarification comment?
- Give a good example of a clarification comment.
- Give an example of a bad clarification comment.
- What does the author mean by an "ugly" comment and why should the be avoided?