AQA · GCSE · Computer Science

    Course version: 8525 · Version from Sept 2020

    Identifier names include names for variables, constants and subroutine…

    Full specification wording

    Programming concepts: Identifier names include names for variables, constants and subroutine names.

    An identifier is the name a programmer gives to an item in a program, and the specification groups three kinds: variables, constants and subroutines.

    Checked against the AQA 8525 specification (opens in a new tab) on .

    • Point 23 of 23

    Study notes

    From the checked teaching notes for this specification point.

    The idea

    An identifier is the name a programmer gives to an item in a program, and the specification groups three kinds: variables, constants and subroutines. A variable identifier names a stored value that can change while the program runs, such as score or userName. A constant identifier names a value fixed when the program is written and not changed afterwards, such as PI or MAX_ATTEMPTS; by convention constants are often written in capitals to signal that they must not be reassigned. A subroutine identifier names a named block of code that performs a task, such as calculateArea or displayMenu, and is used when the subroutine is called. Recognising which kind of item a name refers to helps a programmer read code correctly: assigning to a constant is an error, and calling a subroutine uses a different syntax from reading a variable.

    What earns the marks

    • A variable identifier names a value that may change during execution, for example score.
    • A constant identifier names a value fixed at design time that should not change, for example MAX_ATTEMPTS.
    • A subroutine identifier names a named block of code that carries out a task and is invoked when called, for example calculateArea.
    • Classifying an identifier correctly depends on how the item is used in the program, not merely on its spelling.
    • Suitable names should be descriptive and obey the language's identifier rules, such as no spaces and a letter at the start.

    Common mistakes and how to put them right

    • Treating every identifier as a variable.

      Put it right: Is that constants and subroutine names are also identifiers and are distinguished by their role.

    • Assuming a name written in capitals is automatically a constant in every language.

      Put it right: Is that capitals are a convention signalling intent, and the actual role depends on how the item is declared and used.

    • Confusing a subroutine name with a variable holding its result.

      Put it right: Is that the subroutine name identifies the block of code, while any returned value may be stored in a separate variable.

    Exam tips

    • Read how each identifier is used in the code before classifying it as a variable, constant or subroutine.
    • When suggesting a name, match the role: a fixed value suits a constant-style name, an action suits a verb-like subroutine name.
    • Check suggested names against identifier rules as well as describing the purpose clearly.

    Try the lesson

    The start of the Programming concepts: Identifier names include names for variables, constants and subroutine names. lesson, made from checked teaching notes for this specification point.

    Have a go first

    A programmer writes the line totalScore = 0 at the start of a program. What kind of identifier is totalScore in this line?

    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.

    Carry on with the full lesson

    A week of Premium from your first lesson · Then the free plan continues · No card, no charge

    Test your understanding of Programming concepts: Identifier names include names for variables, constants and subroutine names.

    Active recall beats re-reading. Take an instant quiz now to test what you’ve learned and lock it into long-term memory.

    Take topic quiz

    A week of Premium from your first lesson · Then the free plan continues · No card, no charge