Java

Top  Previous  Next

A student said, “Why not combine the two if statements into one statement?”

 

My reply was to stress the importance of debugging, which is the most time-consuming activity in writing software. Since it is easier to debug two short statements rather than one long statement, it is better to write two “if” statements.

 

Students need to be taught good coding practices from the very beginning.

 

Each program should begin with several comment lines: The student’s name, the date, and the purpose of the program. When we test and debug the program, we have to refer to the purpose to see if we did it correctly. These comments are like an architect’s blueprints.

 

Students should check each others code. This is how it is done in the real world.