Building Blocks of Code: Mastering Functions

1 of 4

ICT · My World Quest — full scheme of work · pioneer

Building Blocks of Code: Mastering Functions

3 more
1/4
For grown-ups

Companion summary

Preparing a short summary…

The Recipe Shortcut

The Recipe Shortcut

Imagine you are a baker who makes the same sponge cake every single day. Would you write out the full recipe from scratch each time — measure, mix, bake, cool — or would you keep one master recipe card and just follow it whenever you need it? Most experienced bakers keep the card. Now think about code. If you needed to calculate the area of a rectangle in ten different places in your program, would you type out the same calculation ten times? Or would it be smarter to write the calculation once and simply call it whenever you need it? That 'recipe card' idea is exactly what a function is in programming. Before you read on, jot down: what do you think a function might look like in code?

💭 Think about this

If you had to give someone the same set of instructions over and over again, what shortcut would you invent to save time?

Finding related videos…