Knowledge Organiser: Subprograms (Functions & Procedures)
This topic summary covers Knowledge Organiser: Subprograms (Functions & Procedures) within Bubble Sort for GCSE Computer Science. Revise Bubble Sort in Algorithms for GCSE Computer Science with 15 exam-style questions and 10 flashcards. This topic appears less often, but it can still be a useful differentiator on mixed-topic papers. It is section 9 of 9 in this topic. Use this topic summary to connect the idea to the wider topic before moving on to questions and flashcards.
Topic position
Section 9 of 9
Practice
15 questions
Recall
10 flashcards
Knowledge Organiser: Subprograms (Functions & Procedures)
Key Terms
- Subprogram: A named block of code that can be called multiple times
- Function: A subprogram that performs a task AND returns a value
- Procedure: A subprogram that performs a task but does NOT return a value
- Parameter: A variable in the subprogram definition that receives an input value
- Argument: The actual value passed to a subprogram when calling it
- Return value: The output sent back from a function using the return keyword
Must-Know Facts
- Functions ALWAYS return a value; procedures NEVER return a value
- Subprograms improve reusability — write once, call many times
- Each subprogram can be tested independently
- Subprograms make code easier to read and maintain
- Bugs fixed inside a subprogram are fixed everywhere it is used
Key Concepts
- Declare a function:
function name(param) ... return value ... endfunction - Declare a procedure:
procedure name(param) ... endprocedure - Call a function:
result = calculateArea(5, 3) - Parameters are placeholders; arguments are the real values passed in
- Functions can be used in expressions; procedures cannot
Common Mistakes
- Confusing functions and procedures: A function RETURNS a value; a procedure does NOT — this distinction is frequently tested and often answered incorrectly
- Confusing parameters and arguments: Parameters are the placeholders in the function definition; arguments are the actual values passed when calling the function
- Saying subprograms run faster: Subprograms do not make code faster — they improve readability, reusability, and maintainability, not execution speed
- Forgetting to use the return value from a function: A function's return value must be stored or used — calling a function without capturing its return is wasted output
- Not indenting subprogram bodies in pseudocode: The body of a function or procedure must be indented — examiners expect correct pseudocode structure
Revise this topic interactively on PrepWise — self-test mode, tap-to-reveal definitions, and Common Mistakes from examiners.
Try the interactive Knowledge Organiser — free →