Please enable JavaScript to use CodeHS

Hawaii EXS1300 Intro to Computer Science

Lesson 2.7 Commenting Your Code

Description

In this lesson, students learn how to style their programs by including comments. Comments allow students to leave notes on their program that makes it easier for other to read. Comments are written in plain English.
Commenting Your Code Example:

/*
 *  multi-line  comments
 */

// single line comments

Objective

Students will be able to:

  • Explain the preconditions and postconditions of a function
  • Create clear and readable comments in their code that help the reader understand the code
  • Explain the purpose of comments