Revise Computing
Revision notesQuestionsFor schools
Log inStart revising free
Revision notesQuestionsFor schoolsLog in
GCSE Computer Science/Supplementary programming practice/Subprograms

Why subprograms

301.12 Subprograms

Practise exam questions

Subprograms — Note 1 of 4

Reasons to split code.

What you need to know

Subprograms (functions and procedures) break code into reusable, named blocks. This makes programs shorter, easier to read, test, and maintain.

What to know

  • Avoid repeating the same code — write it once, call it many times
  • Each subprogram does one clear job
  • Easier to test each part independently
  • Makes the main program shorter and more readable

Code examples

Why use subprograms
python
# Without subprogram: repeated code
print("="*20)
print("Welcome")
print("="*20)

# With subprogram: reusable
def show_header():
    print("="*20)
    print("Welcome")
    print("="*20)

show_header()
← Previous topicString validation301.11 String ManipulationNext note →Procedures301.12 Subprograms

Back to Subprograms

Specification notes for programming are in Paper 2.

Subprograms

Note 1 of 4

  1. 1Why subprograms
  2. 2Procedures
  3. 3Functions
  4. 4Scope + parameters
Topic overview

© 2026 Revise Computing · revisecomputing.co.uk

Privacy noticeTermsContact

Revise Computing is an independent revision resource. It is not affiliated with, or endorsed by, OCR (Oxford Cambridge and RSA Examinations).