Skip to content
Technologies · Foundation

Active learning ideas

Functions and Procedures: Modular Code

Active learning works well for teaching functions and procedures because students need to see modularity in action to grasp its benefits. When learners build and call their own reusable blocks, they experience firsthand how organization improves efficiency and clarity in code.

ACARA Content DescriptionsAC9TDIP03
25–45 minPairs → Whole Class4 activities

Activity 01

Experiential Learning30 min · Pairs

Pair Build: Reusable Dance Function

In pairs, students create a function block with three dance moves like spin, jump, and wave. They call the function four times in a program, adding sounds each time. Partners switch roles to test and tweak for smoother playback.

Construct a program that utilizes functions to break down complex tasks into smaller parts.

Facilitation TipDuring Pair Build, circulate and ask pairs to count the total blocks in their programs before and after using functions to highlight the difference in code length.

What to look forGive students a simple task, like making a character move and say 'hello'. Ask them to draw or describe how they would use a function to do this. Then, ask them to write one sentence explaining why using a function is helpful for this task.

ApplyAnalyzeEvaluateSelf-AwarenessSelf-ManagementSocial Awareness
Generate Complete Lesson

Activity 02

Experiential Learning45 min · Small Groups

Small Group Challenge: Story Action Modules

Groups define two procedures, such as 'hide behind tree' and 'run to friend,' for a simple adventure story. They sequence calls to build the full narrative, then swap one procedure with another's for a remix. Record observations on efficiency.

Analyze the benefits of using functions for code reusability and readability.

Facilitation TipFor the Small Group Challenge, provide a checklist that includes defining modules, testing them, and remixing a peer’s project to emphasize iterative improvement.

What to look forObserve students as they work in ScratchJr. Ask them: 'Can you show me where you defined your function?' and 'Where in your program do you use that function?' Note which students can identify and explain these parts.

ApplyAnalyzeEvaluateSelf-AwarenessSelf-ManagementSocial Awareness
Generate Complete Lesson

Activity 03

Experiential Learning40 min · Whole Class

Whole Class Gallery: Function Share-Out

Each pair creates one unique function for animal behaviors, like 'swim across pond.' Project all on the board for the class to drag into new programs. Discuss which combinations work best and why.

Justify when to create a new function versus writing sequential code.

Facilitation TipIn the Whole Class Gallery, invite students to present their functions and explain why they chose to modularize specific actions in their stories.

What to look forPresent two versions of a simple animation: one with repeated blocks for a character's dance, and one using a 'dance move' function. Ask students: 'Which program is shorter? Which one is easier to understand? Why?'

ApplyAnalyzeEvaluateSelf-AwarenessSelf-ManagementSocial Awareness
Generate Complete Lesson

Activity 04

Experiential Learning25 min · Individual

Individual Debug: Fix the Modular Maze

Students receive a maze program with broken function calls. They identify the issue, recreate the 'turn corner' procedure correctly, and test runs. Note before-and-after step counts.

Construct a program that utilizes functions to break down complex tasks into smaller parts.

What to look forGive students a simple task, like making a character move and say 'hello'. Ask them to draw or describe how they would use a function to do this. Then, ask them to write one sentence explaining why using a function is helpful for this task.

ApplyAnalyzeEvaluateSelf-AwarenessSelf-ManagementSocial Awareness
Generate Complete Lesson

A few notes on teaching this unit

Approach this topic by having students build small, meaningful functions that solve real problems in their programs. Avoid starting with abstract definitions of functions; instead, let students discover their purpose through repeated use. Teachers should model tracing function calls step by step to prevent the misconception that functions run automatically.

Successful learning shows when students can define a function, call it multiple times, and explain why modular code is useful. They should also compare modular and sequential code, identifying differences in length and readability.


Watch Out for These Misconceptions

  • During Pair Build, watch for students who believe functions are only useful for long programs.

    Have students count the blocks in their sequential and modular versions, then ask them to justify why modularity helps even in short programs.

  • During Whole Class Gallery, listen for explanations that suggest functions run all code at once.

    Ask students to trace the order of blocks step by step when calling a function, using visual cues like pointing to the screen to reinforce sequential execution.

  • During Small Group Challenge, notice if students assume functions work without testing.

    Challenge groups to intentionally break their functions by changing a value, then fix the errors through peer review, emphasizing that functions require testing like any other code.


Methods used in this brief