Part 3 · Think like a programmer · Learn to program

Knowledge Videos

Short animated explainers, organised by subject.

Learn to program

8 videos

A step-by-step path for complete beginners: how computers and the web work, then HTML, CSS, JavaScript, Go and a full-stack app of your own.

Part 3 · Think like a programmer

1:27

8What is a program?

A program is a list of exact instructions the computer follows in order. Algorithm, sequence and bug, explained with a robot that makes a sandwich.

programalgorithmsequencebugbeginner
1:07

9Events: when something happens

An event is something that happens, like a click or a key press, and an event handler is the script that runs when it does. Shown with Scratch blocks.

eventevent handlerScratchbeginner
0:58

10Loops: repeat instead of copy

A loop repeats blocks so you do not copy and paste them. Repeat, forever, and drawing shapes with a loop, shown with Scratch blocks.

looprepeatforeverScratchbeginner
1:08

11Variables: a named box for a value

A variable holds a value under a name, and the value can change. Score, set and change, and what score = score + 1 means.

variablevaluescoreScratchbeginner
1:01

12Conditions: if and else

A condition is a true or false question. If runs blocks when it is true, else runs when it is false. A fork in the road, with an umbrella or a hat.

conditionifelsebooleanScratchbeginner
1:10

13Functions: name a group of blocks

A function is a named group of blocks you define once and call many times. Define, call and parameter, with a draw-a-square function.

functioncallparameterMy BlockScratchbeginner
1:13

14Bugs and debugging

A bug is a mistake in a program. Debugging is finding it and fixing it: predict, run, compare, fix, shown on a square that does not close.

bugdebuggingpredictScratchbeginner
1:38

15From Scratch to JavaScript

The same six ideas in blocks and in text: sequence, variable, condition, loop, function and event, plus what syntax and the console are.

JavaScriptsyntaxconsoleScratchbeginner