Skip to content

Foundations

Structure

Lists, jobs with names, jobs that take a value and hand one back, and the one skill that separates getting it done from getting stuck.

Begin — Unit 01 →

What this is

Programs grow. A box that holds one value is not enough for a row of enemies, and a job that turns up in five places should be written once. This module is about giving a program shape so it stays readable as it gets bigger.

It ends with the most useful unit on the whole shelf: what to do when a program does the wrong thing, by looking at what it did rather than guessing.

Who it’s for

Anyone who has finished Repeating. A list and a loop belong together, and the debugging unit traces a loop by hand.

The shape

  • A box that holds many — lists, reaching into them, and walking along them.
  • A job with a name — write it once, call it wherever you need it, and leave a note.
  • Telling a job what to work on — a job that takes a value and hands one back.
  • When it’s wrong — look, narrow down, read; make the program show its working; suspect your own code first.

That is the end of the programming shelf. From here you pick a language to say these ideas in: Meet BASIC on a machine you like the look of. Or head for the metal, starting with Counting in Twos.

The units

  1. 01A Box That Holds ManyStart →
  2. 02A Job With a NameStart →
  3. 03Telling a Job What to Work OnStart →
  4. 04When It's WrongStart →