Important update from TheSchoolRun
For the past 13 years, TheSchoolRun has been run by a small team of mums working from home, dedicated to providing quality educational resources to primary school parents. Unfortunately, rising supplier costs and falling revenue have made it impossible for us to continue operating, and we’ve had to make the difficult decision to close. The good news: We’ve arranged for another educational provider to take over many of our resources. These will be hosted on a new portal, where the content will be updated and expanded to support your child’s learning.
What this means for subscribers:
- Your subscription is still active, and for now, you can keep using the website as normal — just log in with your usual details to access all our articles and resources*.
- In a few months, all resources will move to the new portal. You’ll continue to have access there until your subscription ends. We’ll send you full details nearer the time.
- As a thank you for your support, we’ll also be sending you 16 primary school eBooks (worth £108.84) to download and keep.
A few changes to be aware of:
- The Learning Journey weekly email has ended, but your child’s plan will still be updated on your dashboard each Monday. Just log in to see the recommended worksheets.
- The 11+ weekly emails have now ended. We sent you all the remaining emails in the series at the end of March — please check your inbox (and spam folder) if you haven’t seen them. You can also follow the full programme here: 11+ Learning Journey.
If you have any questions, please contact us at [email protected]. Thank you for being part of our journey it’s been a privilege to support your family’s learning.
*If you need to reset your password, it will still work as usual. Please check your spam folder if the reset email doesn’t appear in your inbox.
What are procedures and functions?

What are procedures or functions?
In programming a procedure or function is a defined piece of code that can be run multiple times.
Similar to functions in mathematics, in programming functions have to have an input and an output, whilst a procedure can just run code without having any input or output.


Start a unique learning programme!
- Weekly programme for each school year
- Worksheets sent direct to your inbox
- Keeps your child's learning on track
Procedures and functions in KS1
Procedures and functions are highly advanced topics and bridge the gap between intermediate and advanced programming techniques.
Your child is unlikely to be introduced to procedures in KS1 as they are not part of the current computing curriculum at early stages and require an understanding of a programming language.
Procedures and functions in KS2
The concept of procedures / functions will not be introduced until at least Year 5 when your child has a good grasp of basic programming principles and is able to use sequences, loops and conditions effectively.
A procedure is a piece of code that can be run over and over again, which is useful as it prevents us from having to re-write the same code multiple times.
A function is also a piece of code that can be run over and over again, with one key difference: a function should have at least one input and an output. An input to a function is called an argument and an output is called the return.
There is no set way that functions are introduced in the curriculum, however they will usually be introduced using a visual programming language such as Scratch and will allow students to simplify the piece of code they are writing by breaking it down into small, bite-sized chunks.
KS2 procedures and functions coding project
For example: I write a game and want to move my character right when the right arrow key is pressed, or alternatively when the D key is pressed. If I do not use a procedure then I will have to write the same code twice, once to deal with the right arrow key being pressed and once to deal with the D key being pressed. The solution is to write a procedure that can be run multiple times in order to move the character right.
In order to demonstrate this we are going to look at some Scratch code. Before we look at the actual code, however, let's learn about what some of the Scratch blocks do:
Now let’s have a look at some code examples, one that doesn’t use a procedure and repeats the same code multiple times and one that uses a custom block to move our character to the right.
First let’s look at an example that repeats the same code multiple times:
As you can see, in this code we have repeated the same code multiple times. This isn’t very efficient – if we wanted to add in another key that allowed us to move our character right, we would have to repeat the same code again.
We can solve this problem by using a procedure (or, as it's called in Scratch, a custom block). Let’s have a look at what a function might look like in Scratch:
As we have used the Move Right custom block, the repeated code is only one line now, instead of two lines as in the previous example. Althugh we still have the same number of lines of code, by using a custom block we have done two things:
- We have split up our code into smaller sections, meaning that instead of trying to solve one big problem, we are able to solve a number of smaller problems.
- We have made it easier to change the way that our character moves right. Instead of having to change our code in two places, if we want to update our procedure we can just change it inside our custom block.
In our final example I have updated our Move Right custom block so that we also play a sound whenever the character moves, and if we reach the end of the screen we bounce. Notice that I haven’t had to change anything in our main block of code; simply changing the code in the function has allowed us to change what happens when both the right arrow, or the D key is pressed:
Procedures and functions in primary school
Please note that the following guideline for what is taught in each primary year is for guidance only and may not be representative of the way computing is taught at your child’s school.
Year 5
The concept of procedures is introduced and students will have to write basic procedures in a visual programming language such as Scratch.
Year 6
The concept of input and output are added to students' understanding of procedures to create more complex functions.