5 · Coding logic: algorithms & sequencing
The "process" step — the thinking — is where coding lives. And the first idea in coding is the simplest: an algorithm is just a step-by-step set of instructions to get something done. A recipe is an algorithm. Directions to a friend's house are an algorithm. There's nothing magic about it.
The catch is that computers are extremely literal. They do exactly what you say, in exactly the order you say it — no filling in the blanks, no "you know what I mean." That property is called sequencing: the order of the steps matters.
Try writing the algorithm for making a peanut butter sandwich as if for a robot that has never seen one:
- Pick up the bread bag. 2. Open the bag. 3. Take out two slices. …
If you skip "open the bag," the robot tries to grab bread through the plastic. This is the famous lesson teachers use, and Code.org's Computer Science Fundamentals — a widely used K-12 curriculum — builds whole lessons around exactly this idea of precise, ordered instructions (Code.org, n.d.).
So the first skill of a coder isn't typing — it's thinking clearly in small, ordered steps. Get the steps right and in the right order, and you have an algorithm a machine can follow.
Try this (no computer needed). Write the algorithm for an everyday task — brushing your teeth, tying a shoe — as a numbered list, pretending the reader is a literal robot. Then hand it to a friend (or sibling) who must do only what's written, exactly in order. Wherever they get stuck or do something silly, you found a missing or out-of-order step. Fix it. That's debugging.
Check yourself. In one sentence, what is an algorithm? Why does the order of the steps matter so much to a computer?
Sources
Code.org. (n.d.). Computer science fundamentals curriculum. https://code.org/en-US/curriculum/computer-science-fundamentals