Comments that explain and justify data and code structures
A comment that explains what a variable, array, record or algorithm is for and why it was chosen, rather than just repeating what the code does.
Understanding Comments that explain and justify data and code structures in VCE Software Development U3O1
What it does: The comment gives the loop's purpose (finding the highest mark) instead of just saying 'a for loop'. The comment gives the reason for the structure: a record groups fields of different data types for one student. A good comment explains WHY the structure was chosen (fixed size), not just what it is. Describing a variable's purpose says what it is used for in the program, not just its starting value. The wrong option just reads the code aloud. The correct one explains the rule behind the decision. Justifying the choice (fast lookup by key) helps maintainers understand the design decision.
Common mistakes: Python comments start with #, not //. The // line is invalid code and causes a syntax error. It should be '# total: sum used for average'. The comment gives the wrong reason for the array's size. The code creates 7 elements, so the comment must say 7 days. A comment that contradicts the code misleads the next programmer.
Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.
This module's key terms are also in a printable crossword (Modules 48–71) and word search (Modules 10–71).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
# array used because size is fixedFill in the Blanks
Spot the Error
Student with a class code? Join your class →