← Module hub · Unit 1 · Self-check

Unit 1 activity: Ada's ordered procedure

DEVELOPMENT REVIEW DEPLOYMENT - NOT READY FOR RELEASE

Required work: about 12 minutes. Pen and paper is fine; so is a text file. An optional extension at the end adds more if you want it.

Ada Lovelace had to write a procedure for a machine that could not be relied on to fill in anything she left out. You are going to do the same thing with a task you already know how to do, and find out how much of it you have never actually said out loud.

Part 1 — choose a task (1 minute)

Pick something ordinary that you can do without thinking, and that takes six to ten steps: posting a parcel, changing an inner tube, putting a duvet into its cover, returning an overdue library book, making a cheese sandwich for someone else.

Do not pick something you already think of as a procedure — a recipe you follow from a card, or anything with an instruction manual. The exercise only works on something you do from memory.

Part 2 — write the procedure (5 minutes)

Number your steps from 1, and hold to these six constraints. They are what turn a description into a procedure.

  1. One action per step. If a step contains "and", consider splitting it.
  2. Name every object before you use it. If step 6 refers to the tray, some earlier step must have introduced the tray. This is explicit state.
  3. Give every quantity a number. How much, how many, how far, how hot. "Enough" and "a little" are not quantities.
  4. Give every wait a duration or a condition. Either "wait 4 minutes" or "wait until X happens", where X is something observable.
  5. No pronouns. No "it", "them", "the other one". Write the noun again. This feels absurd and it is where most of the gaps get exposed.
  6. State the starting state and the finishing condition. What is true before step 1, and what is true when you are done?

To see the difference the constraints make — bad: "Add some water." Good: "Pour 250 ml of cold water from the tap into the mug introduced in step 1."

Write the whole thing before you edit any of it. You want the first draft to be honest about what you would actually have written.

Part 3 — the literal reader pass (4 minutes)

Read your own procedure the way a machine would: refuse to supply anything that is not written down. Take each step in turn and ask "could I do only what this says, knowing nothing else?"

Mark every gap you find with a letter:

Code Gap
A Unnamed object — a noun used that no earlier step introduced.
B Missing quantity — how much or how many is not stated.
C Missing duration or timing — a wait with no length and no condition.
D Missing precondition — the step only works if something was already true, and nothing says it is.
E Missing repetition or stopping rule — something has to happen more than once and the procedure does not say how many times or when to stop.
F Ambiguous reference — "it", "them", "the other one".
G Hidden decision — the step needs judgement, and the criterion for that judgement is not written down.

Count them. Most people find between five and fifteen in a first draft of a task they have done hundreds of times. That is the normal result and it is the point of the exercise, not a sign that you wrote it badly.

Part 4 — fix one of them properly (2 minutes)

You do not have time to repair the whole procedure, and you do not need to.

Choose the single gap that would cause the worst outcome if a literal reader hit it, rewrite that step so the gap is closed, and write one sentence saying why you chose that gap rather than another.

That sentence is doing real work. Deciding which unstated assumption matters most is the same judgement you will need in Unit 2, when you decide which parts of a generated output have to be checked and which do not.

Now take the checkpoint

This unit's checkpoint is cp01-ordered-steps. It gives you somebody else's procedure and asks what is missing from it — the same literal-reader pass you have just done on your own work, which is considerably easier on a stranger's writing than on your own. Parts 1 to 4 are all you need for it.

python3 selfcheck.py run cp01-ordered-steps          # or use the browser self-check

Run the Python route from course/lab/. If you get it wrong, read the feedback before retrying: it distinguishes between things genuinely missing from a procedure and background knowledge that a procedure is not obliged to supply, and that distinction is the one this unit exists to teach.

Keep your annotated procedure. Unit 6 is about writing specifications precise enough to be tested, and it will ask you to look at this again.

Optional extensions

Optional. These sit outside the core study time, are not required for the checkpoint, and nothing later in the module depends on them.

Repair the rest of the procedure (about 5 minutes). Part 4 asked for one repair. Close the remaining gaps as well, then reread the result: it will be longer, flatter and duller than your first draft, and it will be the version a literal reader could follow. That trade is the one Note G makes on every page.

Swap with someone else (about 5 minutes). Run the literal-reader pass on another learner's procedure and have them run it on yours. Gaps in a stranger's writing are obvious; gaps in your own are invisible by construction, which is the whole difficulty this unit is about.

For learners who write code (about 15 minutes). Rewrite your procedure as a variable table in the style of Note G. Give each object a name — V1, V2, and so on — and for each step record: the operation, the variables read, the variable written, and the state of every variable afterwards. Then answer two questions. Which steps turned out to read a variable that had never been written? And where did you need a loop, and what is its termination condition?

Marking guidance — open this once you have done the activity, to check your own work

The activity has no single correct output — the tasks differ from learner to learner. What can be marked is whether the gaps were found, and whether they were classified for the right reason.

A worked example

Here is a first draft of the kind learners typically produce, for posting a parcel. The gap codes are those from the activity.

  1. Put the item in a box.
  2. Seal the box.
  3. Write the address on it.
  4. Take it to the post office.
  5. Queue.
  6. Tell them what service you want.
  7. Pay.
  8. Keep the receipt.

Annotated:

Step Code What a literal reader cannot do
1 A, B No box has been introduced, and no size is given. Which item, and which box?
2 A Sealing requires tape or a seal. Nothing has introduced any.
3 F, A "It" — the box or the item? And no address has been supplied to the procedure at all.
3 D Writing on a sealed box assumes a writable surface and a pen; neither is stated.
4 A, D Which post office? The procedure never establishes that one is open, or reachable.
5 E Queue until when? The stopping condition is the whole content of the step.
6 A, G "Them" is undefined, and which service is a decision with no stated criterion.
7 B How much? The amount is produced by step 6 and never captured anywhere.
8 D The receipt was never introduced; step 7 has to produce it for step 8 to keep it.

Two features of that annotation are worth pointing out to learners.

The gaps cluster around values that are produced and then needed later. The address, the price, the receipt: each is a value that some step must generate and store before a later step can use it. That is precisely the explicit-state property from the reading. In Note G, every such value has a named column and a line that puts it there.

Step 5 is the interesting one. "Queue" is not a single action; it is a repetition with a termination condition, and the condition is the only part that matters. Learners who spot repetition and stopping rules have understood control flow, which is the hardest of the three properties to see in everyday language.

For a learner marking their own work

Count the gaps you found, then check your classification against these two questions.

Did I mark anything that is not really a gap? A procedure has to state every action, object and quantity it depends on. It does not have to explain what the result is for, why anyone would want it, or supply general background knowledge about the world. "It doesn't say what a parcel is" is not a gap in the procedure. The distinction matters and the checkpoint tests it.

Did I miss a whole category? Look at the seven codes and see which ones you never used. Most people find A, B and F easily, because they are visible on the page. The three that get missed are:

If you used none of D, E or G, go back through your procedure once more looking only for those. There is almost certainly at least one.

A good answer to Part 4 chooses its gap by consequence, not by how obvious it is: which gap would produce the worst outcome if a literal reader hit it? A learner who repairs the easiest gap has done the exercise; a learner who repairs the most dangerous one has done the thinking that Unit 2 needs.

Repairing the remaining gaps, swapping procedures with someone else, and the Note G variable table are all optional extensions. They are not part of the required work, they are not needed for the checkpoint, and the guidance below assumes they have not been done.

For an instructor

Expected time: 12 minutes for the required work. Formative; not suited to a grade. The optional extensions at the end of the activity add roughly 5, 5 and 15 minutes and are outside the core budget.

What a strong response looks like:

What to intervene on:

Observation Likely cause Response
Very few gaps found The learner is reading co-operatively, supplying meaning as they go. Have them swap procedures with someone else. Gaps in a stranger's writing are obvious; gaps in your own are invisible by construction.
Gaps found only of types A, B, F Surface reading. Ask directly: "which step happens more than once, and how does it stop?"
Procedure written as prose Instruction not followed, or the task chosen was too abstract. Reassign to a physical task with objects that can be pointed at.
Learner marks background knowledge as a gap Over-application of the rule. Distinguish "the procedure never introduces the tape" from "the procedure never explains what tape is". Only the first is a defect.

The point to make in feedback, whatever the cohort produces. Unstated assumptions are invisible to the person holding them. That is not carelessness; it is what an assumption is. The remedy is not to try harder, it is to have a procedure for finding them — which is why the activity gives seven codes instead of telling learners to check their work carefully.

This also sets up the module's central problem. In Unit 4 you will read a generated routine that looks complete, and the assumptions it makes will be just as invisible as the ones in your own procedure — with the added difficulty that they are somebody else's assumptions, made by a process that has no obligation to be consistent about them.

On the historical material

If learners ask which parts of the "first program" story they are supposed to believe, the honest answer is the one on the student page: publication date and the existence of the ordered table are established; priority relative to Babbage's unpublished notebooks and the division of labour on Note G are contested and cited to the relevant historical sources in the reading. Direct them to course/historical-notes.md and to Unit 7 rather than resolving it in discussion.

Do not let the contested points be settled by an AI system's confident summary. That is a live and slightly awkward demonstration of the module's own thesis, and it is worth making explicitly if it comes up.

The checkpoint

This unit's checkpoint is cp01-ordered-steps. Its question, options, correct answer and diagnostics are defined once, in the checkpoint block at the end of this file; ../lab/checkpoints.py and the browser self-check both read that block, so there is a single source and the routes cannot drift apart.

It tests the same literal-reader pass as the activity, and in particular the distinction between a genuine omission and background knowledge a procedure is not required to supply. If a learner reports failing it, ask them to say which nouns in the given procedure were never introduced before use — that is the question the framework's own feedback pushes them towards.

python3 selfcheck.py run cp01-ordered-steps          # or use the browser self-check

Your private activity record

Browser storage is not a permanent copy

Progress is kept only in this browser, profile and device. Private browsing, clearing site data, removing the profile, a browser reset, storage eviction or device loss can erase it. Keep important answers and contributions separately.

These notes stay in this browser unless you download a backup or activity log.