The Sandwich Problem
Why computers do exactly what you say — not what you mean
Written by the RadarTrek editorial team · June 2026
Most people think programming is hard because of the syntax — the arcane symbols, the brackets, the semicolons. It's not. Programming is hard because computers are brutally, unforgivingly literal. Once you understand that, everything else becomes easier.
The classic experiment
Here's an exercise teachers use to explain programming. Tell someone to make you a peanut butter sandwich. Then do exactly what they say — word for word, nothing more.
A computer is the world's most capable — and most literal — assistant
Imagine hiring someone who is infinitely capable but has zero common sense, zero assumptions, zero initiative. They do exactly what you say. "Clean the house" means nothing to them. "Vacuum the living room carpet in parallel rows, working from the far corner toward the door, emptying the bag when the indicator light turns red" — that they can do. Programming is learning to give instructions to this person.
▶ The sandwich instructions
Instruction: "Put the peanut butter on the bread"
Result
You pick up the closed jar of peanut butter and place it on top of the slice of bread.
Technically correct. Completely useless.
Revised: "Spread the peanut butter on the bread"
Result
You put the knife flat on the bread and stare. What peanut butter? The jar is still closed.
You never said to open it.
Final: "Open the jar, scoop some peanut butter with the knife, spread it across the top surface of one slice of bread"
Result
Sandwich successfully made.
This is how you write code. Every step. Every assumption stated explicitly.
You already do this — you just don't notice
Think about the last time you gave someone directions to your home. If you said "turn left at the lights" — which lights? How far? What if they're coming from the other direction? You probably gave extra context to someone unfamiliar with the area that you'd skip for a neighbour. Programming is always giving instructions to the unfamiliar stranger.
IKEA instructions vs a recipe from your mum
A recipe from your mum says "cook until done" — she knows you know what "done" looks like. An IKEA instruction manual shows every screw, every angle, every step numbered, nothing assumed. It feels over-specified to an experienced person. To a beginner (or a robot), it's exactly right. Code is always IKEA instructions, never "your mum's recipe."
Why this matters for every language
- JavaScript, Python, Java — If you forget a comma or a bracket, the program stops. Not slows down — stops completely and gives you an error.
- SQL — "Give me all customers" means nothing. "SELECT * FROM customers WHERE active = true" gives you exactly what you asked for.
- HTML and CSS — "Make it blue" does nothing. 'color: #3B82F6;' changes the colour to exactly that shade of blue.
- Git commands — "Save my work" is meaningless to Git. "git add . && git commit -m 'Add login form'" saves your work with a specific description.
The liberating realization
You already know how to think in explicit steps — you give driving directions, follow recipes, write meeting agendas. The only difference with programming is you have to be even more specific, and the vocabulary follows strict rules. The thinking is the same. The vocabulary is new.
Planning before coding
Every good programmer thinks through what they're asking the computer to do in plain language first — before writing a single line of code. This habit saves hours.
▶ Plan before you code: is this number even or odd?
Plain English: what do we want?
Result
We want to know if a number can be divided by 2 with no remainder.
What's our input?
Result
A number. Let's say the user types 6.
What's the decision?
Result
IF the number divided by 2 leaves no remainder → say "even". OTHERWISE → say "odd".
What's our output?
Result
One word: "even" or "odd".
Now write it — same logic, different language vocabulary
Result
JavaScript: if (n % 2 === 0) { return "even" } else { return "odd" }
Python: "even" if n % 2 == 0 else "odd"Same idea. Different vocabulary. Exactly like "I love you" vs "Je t'aime" vs "Ti amo."
Try this
Write instructions for a robot to make a cup of tea — including where the kettle is, what "boiling" means, how full the cup should be, and how long to wait for the teabag. Notice how many steps seem obvious to you but would stump a literal machine. That gap is the programmer's mindset gap.