Skip to content
Computing · Year 10

Active learning ideas

Subroutines and Functions

Active learning helps Year 10 students see how subroutines and functions reduce repetition and clarify logic in programs. Working in pairs, groups, and individually builds fluency with modular design, making abstract concepts concrete through shared problem-solving and peer feedback.

National Curriculum Attainment TargetsGCSE: Computing - Programming Fundamentals
25–45 minPairs → Whole Class4 activities

Activity 01

Jigsaw35 min · Pairs

Pair Programming: Modular Menu System

Pairs create a text-based menu program. Write procedures for displaying options and handling user choices, plus a function to validate inputs. Test the full program with sample runs and swap code for peer review.

Justify the use of subroutines to improve code readability and maintainability.

Facilitation TipDuring Pair Programming, circulate to prompt partners to alternate the driver role every four lines of code to share cognitive load.

What to look forProvide students with a short Python code snippet that uses a procedure and a function. Ask them to identify which is which, explain why, and describe what the return value (if any) represents.

UnderstandAnalyzeEvaluateRelationship SkillsSelf-Management
Generate Complete Lesson

Activity 02

Jigsaw45 min · Small Groups

Small Groups: Refactor Challenge

Provide groups with linear 'spaghetti' code for a quiz game. Identify repeated tasks and convert them into procedures and functions. Groups present their modular versions, explaining improvements in readability.

Differentiate between a procedure and a function based on their return values.

Facilitation TipIn the Refactor Challenge, provide colored highlighters so groups mark reused blocks before rewriting them as subroutines.

What to look forPresent students with a simple problem (e.g., calculating the area of a rectangle and printing the result). Ask them to write down the pseudocode for two subroutines: one to calculate the area (a function) and one to display the result (a procedure).

UnderstandAnalyzeEvaluateRelationship SkillsSelf-Management
Generate Complete Lesson

Activity 03

Jigsaw30 min · Whole Class

Whole Class: Function Trace Relay

Project a program with multiple functions. Divide class into teams; each traces one function's execution path on paper. Teams share findings to reconstruct the full flow and fix errors.

Design a program structure using multiple subroutines to perform distinct tasks.

Facilitation TipDuring the Function Trace Relay, give each student a unique colored pen to annotate the execution path on the whiteboard.

What to look forPose the question: 'Imagine you are building a program to manage a library. What are three distinct tasks you could create as separate subroutines, and would each be a procedure or a function? Justify your choices.'

UnderstandAnalyzeEvaluateRelationship SkillsSelf-Management
Generate Complete Lesson

Activity 04

Jigsaw25 min · Individual

Individual: Subroutine Design Blueprint

Students outline a program for sorting student scores using pseudocode. Define 4-5 subroutines or functions with parameters and returns. Share blueprints for class feedback before coding.

Justify the use of subroutines to improve code readability and maintainability.

Facilitation TipFor the Subroutine Design Blueprint, remind students to label inputs, outputs, and side effects before writing any code.

What to look forProvide students with a short Python code snippet that uses a procedure and a function. Ask them to identify which is which, explain why, and describe what the return value (if any) represents.

UnderstandAnalyzeEvaluateRelationship SkillsSelf-Management
Generate Complete Lesson

A few notes on teaching this unit

Teach procedures first as “tasks without answers,” then functions as “tasks with answers.” Use live coding to model both, deliberately making mistakes and fixing them together. Research shows tracing by hand on paper or whiteboards strengthens mental models more than passive reading. Avoid jumping straight to definitions; anchor understanding in solving small, familiar problems before naming the concepts.

Students will justify their choices of procedures and functions, trace code execution accurately, and refactor messy snippets into clean modules. Successful learning shows in clear explanations, correct outputs, and confident discussions about readability and maintenance.


Watch Out for These Misconceptions

  • During Pair Programming, watch for students who treat procedures and functions as interchangeable.

    Ask one partner to add a print statement inside the supposed function while the other traces the flow. If no value is returned, highlight the missing return statement and discuss why a function without a return is only a procedure in disguise.

  • During Refactor Challenge, watch for students who claim subroutines slow down small programs.

    Ask groups to time both the original and refactored versions on their machines. Have them change a single line in the original and in the refactored code, timing the edits to show local changes reduce debugging time.

  • During Function Trace Relay, watch for students who assume functions only return numbers.

    Insert a function that returns a string or boolean into the trace. Pause the relay to ask students to predict the type and justify their answer before running the code.


Methods used in this brief