First programs in blocks

Computer Science · Key Stage 1 · The School

Blocks are instructions

In a block editor, each block is one instruction. Move 10 steps. Turn 15 degrees. Say hello. Snap them together, top to bottom. The computer follows them in order. Nothing is hidden. The program IS what you can see. That is why blocks are how everyone should start.

Repeat instead of copying

To draw a square you go: move, turn, move, turn, move, turn, move, turn. That is eight blocks. Or it is two blocks inside a REPEAT 4 block. Repeating is shorter. It is easier to change, so make it repeat 3 for a triangle. And it is harder to get wrong. Whenever you find yourself copying blocks, reach for repeat.

Predict, then run

Before you press go, say out loud what you think will happen. If you are right, you understand your program. If you are wrong, you have just learned something. And you learned it at the moment you were most interested. Predicting first turns running the program into an experiment. Without it, it is a lottery.

Make a sprite move ten steps, ten times. Drag ten move blocks in a row. It works. Now delete them all. Use one repeat 10 block with a single move inside. It does the same thing. Now change it to twenty steps. With the loop you edit ONE number. With the ten blocks you edit ten. And if you miss one, nothing tells you. That is why loops exist.

Swap two blocks around and you have written a different program. Every block is the same. Move then turn walks a square. Turn then move walks a different shape entirely. Computers never work out what you meant. They do exactly what is there, in exactly the order it is in, every single time. That sounds unforgiving. It is the most useful thing about them. The computer is consistent, so a program that goes wrong went wrong for a reason you can find. When your sprite ends up somewhere odd, look at the order of your blocks first, not last.

The School — all subjects · Knowledge map