Comment Your Code
Programs & Judgement · comment your code · add comments and clear names so code is easy to follow, test and debug

Kavi Opens an Old Program
Kavi opened a program from last month. "x = 0 … a1 = a1 + 1 — what does any of this do?" Kavi groaned. There were no notes, and every name was a single letter. So Kavi fixed it two ways. First, clear names: x became totalScore, a1 became isCorrect. Now each line reads like a sentence. Then a comment — a note for people that the computer skips: # give a bonus so hard questions feel fair. "A good comment says WHY, not just what," Kavi hooted. "Clear names and honest comments — now the program is easy to follow, easy to test, and easy to debug."
What your child will learn
A peek inside
Try this at home: A note for people that the computer skips when it runs is called a ____.
Ready to play and learn?
Start the free interactive lesson, or print the handout for screen-free play.
Part of Computing · Stage 6 · S6 on KAVI Academy — a secular, whole-child learning platform for ages 5–12.
