Header comments for code maintenance
A comment at the top of a file that records the program's purpose, author, date and any changes made, so others can understand and maintain the code.
Understanding Header comments for code maintenance in VCE Software Development U4O1
What it does: This line is a change log entry because it gives the date of an edit and describes what was changed. A purpose line tells anyone opening the file what the program is for before they read any code. A header comment should state the program's purpose clearly. A vague comment gives the next programmer no useful information. A change log records each edit. Deleting the header loses the history that helps others maintain the code. In Python, a comment must start with #. Without it, Python tries to run the text as code and shows an error. Comments are ignored when the program runs. Header comments exist to support maintenance by humans.
Common mistakes: The date line is missing the # symbol, so Python reads it as code and gives a syntax error. It should be '# Date: 12/03/2025'. // is not a comment in Python, so the version note causes a syntax error. A Python header comment line must start with #.
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 82–114) and word search (Modules 3–114).
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
header commentFill in the Blanks
Spot the Error
Student with a class code? Join your class →