Skip to content
Computing · Year 11

Active learning ideas

Subroutines, Functions, and Modularity

Active learning works for subroutines and functions because students must physically break down problems, see immediate consequences of their design choices, and experience firsthand how modularity reduces errors. When students refactor messy code or debug broken functions together, they move from abstract concepts to concrete outcomes that reveal why organisation matters.

National Curriculum Attainment TargetsGCSE: Computing - ProgrammingGCSE: Computing - Software Development
25–45 minPairs → Whole Class4 activities

Activity 01

Flipped Classroom30 min · Pairs

Pair Refactoring Challenge: Modularise a Calculator

Provide students with a linear script for a basic calculator. In pairs, identify repeated operations and refactor them into functions with parameters. Test the modular version by adding a new operation and compare debugging time to the original.

Analyze the benefits of using functions for code organization and debugging.

Facilitation TipDuring the Pair Refactoring Challenge, circulate and ask each pair to verbally explain why they chose specific functions before they write any code, forcing early design thinking.

What to look forProvide students with a short Python code snippet containing a simple function. Ask them to identify the function name, its parameters (if any), and the arguments passed when it's called. Then, ask them to write one sentence explaining what the function does.

UnderstandApplyAnalyzeSelf-ManagementSelf-Awareness
Generate Complete Lesson

Activity 02

Flipped Classroom45 min · Small Groups

Small Group Design Sprint: Modular Game Logic

Groups outline a simple text-based game, then decompose it into functions for input handling, scoring, and output. Write and integrate the functions, passing arguments between them. Share one function with the class for peer review.

Differentiate between parameters and arguments when calling a function.

Facilitation TipFor the Small Group Design Sprint, provide a timer and enforce strict role rotation so every student contributes to function definition, parameter design, and testing phases.

What to look forPresent students with a poorly structured program that repeats code. Ask them to refactor a section of the code by creating a new function. They should then explain how their new function improves the code's organization and reusability.

UnderstandApplyAnalyzeSelf-ManagementSelf-Awareness
Generate Complete Lesson

Activity 03

Flipped Classroom35 min · Whole Class

Whole Class Debug Relay: Function Fault-Finding

Display a buggy modular program on the board. Teams take turns identifying errors in specific functions, passing arguments correctly, and suggesting fixes. The class votes on solutions before running the updated code together.

Construct a program that effectively utilizes multiple user-defined functions.

Facilitation TipIn the Whole Class Debug Relay, assign each error to a different group and require them to present the fix using the function’s purpose as the anchor for their explanation.

What to look forPose the question: 'Imagine you are debugging a large program. How does using functions make this process easier compared to having one long, continuous block of code? Discuss specific scenarios where functions aid in finding and fixing errors.'

UnderstandApplyAnalyzeSelf-ManagementSelf-Awareness
Generate Complete Lesson

Activity 04

Flipped Classroom25 min · Individual

Individual Function Portfolio: Reusable Utilities

Students create three utility functions, such as string validation or list sorting, with clear parameters. Document usage examples and test cases. Submit for teacher feedback on modularity and reusability.

Analyze the benefits of using functions for code organization and debugging.

What to look forProvide students with a short Python code snippet containing a simple function. Ask them to identify the function name, its parameters (if any), and the arguments passed when it's called. Then, ask them to write one sentence explaining what the function does.

UnderstandApplyAnalyzeSelf-ManagementSelf-Awareness
Generate Complete Lesson

A few notes on teaching this unit

Teachers approach this topic by having students experience the pain of repetition first, then introducing functions as the relief. Use live coding to model how a small change in one function updates everywhere it’s called. Avoid teaching function syntax in isolation; instead, embed it in meaningful tasks where students feel the benefit of reuse immediately. Research shows that students grasp parameters better when they see mismatched arguments crash the program, so design activities that make these errors visible and fixable in real time.

Successful learning looks like students confidently breaking problems into smaller pieces, passing arguments correctly, and explaining how isolated functions improve debugging and reuse. By the end, they should articulate why modularity matters in their own words and apply it in new contexts without prompting.


Watch Out for These Misconceptions

  • During the Pair Refactoring Challenge, watch for students treating functions as mere shortcuts rather than organised logic blocks.

    Pause the activity after 10 minutes and ask each pair to point to a function they created and explain what specific problem it solves in isolation; redirect any vague answers by having them trace how changes to that function affect the program’s output.

  • During the Whole Class Debug Relay, watch for students confusing parameters and arguments in error messages.

    Require each group to write the corrected function call on the board, labeling each argument and mapping it to the corresponding parameter, then explain why mismatched types caused the original error.

  • During the Small Group Design Sprint, watch for students defaulting to global variables for shared state.

    Introduce a design rule: no global variables allowed in this sprint. If students use them, ask them to refactor by moving shared data into parameters and observe how the function becomes more reusable and predictable.


Methods used in this brief