AQA · GCSE · Computer Science
Course version: 8525 · Version from Sept 2020
Use meaningful identifier names and know why it is important to use them.
Full specification wording
Programming concepts: Use meaningful identifier names and know why it is important to use them.
A meaningful identifier is a name a programmer chooses for something in a program so that its purpose is clear from reading it.
Checked against the AQA 8525 specification (opens in a new tab) on .
- Point 22 of 23
Study notes
From the checked teaching notes for this specification point.
The idea
A meaningful identifier is a name a programmer chooses for something in a program so that its purpose is clear from reading it. Instead of naming a variable x or a, a programmer writes totalScore, itemPrice or pupilAge. The same applies to constants such as VAT_RATE and to subroutines such as calculateAverage. Meaningful names matter because programs are read far more often than they are written: by the original author returning later, by teammates, and by anyone debugging or maintaining the code. A clear name reduces the chance of mixing up two similar values, makes errors easier to spot, and removes the need for explanatory comments about what a value holds. In an exam question you may be asked to pick the better of two names, or to explain why one name is preferable.
What earns the marks
- A meaningful identifier clearly indicates the purpose or content of the item it names, for example totalScore for a running total.
- Meaningful names improve readability, so code is easier to understand when revisited or read by another programmer.
- Clear names reduce the risk of errors, such as confusing two similarly named variables or misusing a constant.
- Meaningful names make maintenance and debugging easier because the programmer can locate the relevant value quickly.
- Names must still obey identifier rules, such as starting with a letter and containing no spaces, while remaining descriptive.
Common mistakes and how to put them right
Assuming any short name is acceptable because the program runs.
Put it right: Is that a name must communicate purpose to a human reader, not merely satisfy the compiler or interpreter.
Thinking a meaningful name must be very long.
Put it right: Is that a concise but descriptive name such as itemPrice is better than an overlong phrase.
Believing comments can fully replace good names.
Put it right: Is that clear identifiers reduce the need for comments and keep the code itself self-explanatory.
Exam tips
- When comparing two names, state what each one tells the reader and choose the one whose purpose is clearer.
- Link the benefit to a concrete consequence, such as easier debugging or lower risk of mixing up values.
- Check the chosen name against identifier rules as well as readability, since a descriptive name with a space would still be invalid.
Try the lesson
The start of the Programming concepts: Use meaningful identifier names and know why it is important to use them. lesson, made from checked teaching notes for this specification point.
Have a go first
A programmer stores a player's total points in a variable. Which identifier name is the most meaningful choice?
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 Programming concepts: Use meaningful identifier names and know why it is important to use them.
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