OCR · GCSE · Computer Science
Course version: J277 · Version from Sept 2022
Maintainability Use of sub programs Naming conventions Indentation…
Full specification wording
Defensive design: Maintainability Use of sub programs Naming conventions Indentation Commenting
Maintainability means another programmer can read, understand and safely change a program later.
Checked against the OCR J277 specification on .
- Point 3 of 3
- 4 key terms
Study notes
From the checked teaching notes for this specification point.
The idea
Maintainability means another programmer can read, understand and safely change a program later. Four techniques help. Sub programs break a large task into named modules, so each part can be tested and edited without disturbing the rest; for example, a quiz program might use separate sub programs for loading questions, checking an answer and updating the score. Naming conventions give variables and sub programs meaningful names such as totalScore or calculateAverage, so their purpose is obvious. Indentation shows which statements sit inside loops, selections and sub programs, making the control flow visible. Commenting adds short explanations of why code exists, what inputs and outputs a sub program expects, or which author and version applies. Together these reduce the chance that a change in one place breaks another part, and they speed up debugging and teamwork.
What earns the marks
- Explains that maintainability is about how easily code can be read, understood and modified by someone other than the original author.
- Describes how sub programs split a program into named, self-contained modules that can be developed, tested and reused independently.
- Explains that meaningful naming conventions make the role of variables, constants and sub programs clear without needing to trace every line.
- Describes how indentation visually groups statements inside selection, iteration and sub program blocks so the structure of the code is obvious.
- Explains that comments record purpose, assumptions, inputs, outputs or version information that the code alone does not convey.
- Links the techniques together, for example noting that a well-named, indented and commented sub program is easier to debug and reuse than an unnamed block of code.
Common mistakes and how to put them right
Writing comments that merely restate the code, such as 'increment i by 1' next to i = i + 1.
Put it right: Comments should explain why the step is needed or what the sub program expects.
Using vague names such as data1, temp or thing.
Put it right: Use descriptive names such as pupilMark or averageScore that reveal the purpose.
Indenting only some lines inside a loop or selection, which hides the block structure.
Put it right: Indent every statement within the block consistently and align the closing keyword with the opening one.
Exam tips
- When asked to improve a piece of code, name the specific technique you are applying, such as 'use a sub program' or 'add a comment', rather than writing only 'make it neater'.
- If you rewrite code in an answer, keep the logic identical and change only the maintainability feature requested, so the marker can see exactly what you improved.
- Use British spelling consistently, for example 'initialise' and 'colour', and keep code keywords in the case used by the language in the question.
Try the lesson
The start of the Defensive design: Maintainability Use of sub programs Naming conventions Indentation Commenting lesson, made from checked teaching notes for this specification point.
Have a go first
Which maintainability technique involves breaking a large program into smaller, self-contained sections that each perform one task?
Listen
Maintainability means another programmer can read, understand and safely change a program later. Four techniques help. Sub programs break a large task into named modules, so each part can be tested and edited without disturbing the rest; for example, a quiz program might use separate sub programs for loading questions, checking an answer and updating the score. Naming conventions give variables and sub programs meaningful names such as totalScore or calculateAverage, so their purpose is obvious. Indentation shows which statements sit inside loops, selections and sub programs, making the control flow visible. Commenting adds short explanations of why code exists, what inputs and outputs a sub program expects, or which author and version applies. Together these reduce the chance that a change in one place breaks another part, and they speed up debugging and teamwork. A strong answer earns marks for these points. Explains that maintainability is about how easily code can be read, understood and modified by someone other than the original author. Describes how sub programs split a program into named, self-contained modules that can be developed, tested and reused independently. Explains that meaningful naming conventions make the role of variables, constants and sub programs clear without needing to trace every line. Describes how indentation visually groups statements inside selection, iteration and sub program blocks so the structure of the code is obvious. A common slip: Writing comments that merely restate the code, such as 'increment i by 1' next to i = i + 1. Instead, comments should explain why the step is needed or what the sub program expects. Exam tip: When asked to improve a piece of code, name the specific technique you are applying, such as 'use a sub program' or 'add a comment', rather than writing only 'make it neater'.
Key words
Say what each word means before you turn the card.
Maintainability
Try answering aloud or in your head before turning the card.
Sub programs
Try answering aloud or in your head before turning the card.
Naming conventions
Try answering aloud or in your head before turning the card.
Indentation
Try answering aloud or in your head before turning the card.
See every definition
- Maintainability
- Means another programmer can read, understand and safely change a program later.
- Sub programs
- Break a large task into named modules, so each part can be tested and edited without disturbing the rest.
- Naming conventions
- Give variables and sub programs meaningful names, so their purpose is obvious.
- Indentation
- Shows which statements sit inside loops, selections and sub programs, making the control flow visible.
There is more to this lesson
The full lesson goes on to check your understanding and help you earn the marks. Create a free account to carry on, with your progress saved.
A week of Premium from your first lesson · Then the free plan continues · No card, no charge
Test your understanding of Defensive design: Maintainability Use of sub programs Naming conventions Indentation Commenting
Active recall beats re-reading. Take an instant quiz now to test what you’ve learned and lock it into long-term memory.
A week of Premium from your first lesson · Then the free plan continues · No card, no charge