JS Sketchbooksee JavaScript think ✏️
← back to phase 0

0.1 — What is a program?

You’ve used thousands of programs — every app, game and website is one. But what actually is a program? Not roughly. Exactly.

Here’s the whole secret up front: a program is a list of instructions, written in advance, followed exactly. Like a recipe — except the cook never improvises, never gets bored, and finishes a million steps before you blink. Let’s watch one run.

watch it happen
console.log("Crack the egg");
console.log("Whisk with milk");
console.log("Pour into the pan");
console.log("Flip after 2 minutes");

On the left: a real JavaScript program — four instructions, each telling the machine to say one line of a pancake recipe. On the right: the same four instructions as the machine’s to-do list.

the instructions, as the machine sees them1. Crack the egg2. Whisk with milk3. Pour into the pan4. Flip after 2 minutes
under the hood

The deeper story, with the real names for things — this part is what turns “I saw it” into “I can explain it.”

The proper word for “the machine carries out an instruction” is execute. Programmers say “the code executes” or “this line runs” — same thing: the machine did what the instruction said.

A processor does not understand English — and not JavaScript either. Deep down it understands only machine code. Machine code is made of unimaginably small steps, like “copy this number over there.”

Something has to translate your JavaScript into those small steps. That translator is the engine — the star of the next lesson.

About speed: a modern processor performs billions of those small steps every second. That is the whole trade: the machine brings speed and perfect obedience; you bring the thinking.

And that thinking has to be exact. Programming means deciding precisely what should happen — the machine never fills a gap for you. “Make it look nice” is not an instruction it can execute. That vagueness is exactly why programming languages exist.

One property is the foundation of your career: programs are deterministic. Deterministic means: the same program, started the same way, does the same thing every time. That reliability is what makes automated testing possible — a test can check the same promise a thousand times and mean it.

your turn

✏️ Quick check 1

Which of these is closest to what a program really is?

✏️ Quick check 2

You accidentally wrote the instructions in the wrong order — “pour into the pan” before “whisk with milk.” What does the machine do?

✏️ Quick check 3

An instruction says “make the pancake nice.” What happens?

teach it back

🗣️ Now teach it back

Explain to a friend who has never coded: what is a program, and why does the ORDER of instructions matter so much? Use any analogy you like (kitchen, LEGO manual, driving directions…).

Write it as if your friend is sitting next to you. Saved to your journal — future-you will use these notes to teach others.

a few sentences, minimum — you’ve got this
to remember
A program = a list of instructions, followed one at a time, top to bottom.
The machine never chooses, skips, or fixes your order — it obeys exactly. It runs what you wrote, not what you meant.
It isn’t smart — it’s unimaginably fast: billions of tiny steps per second, identically every time.