What Making a Sandwich Can Teach Us About Coding

The bag of bread, the peanut butter, and the jelly were all sitting innocently on the counter. My hungry kids were eyeing me expectantly.

“How about you tell me how to make the sandwich this time?”

“Uh… okay. Just put the peanut butter on the bread, then the jelly on top.”

Peanut butter jar goes on the bag of bread. Jelly goes on top, squishing the whole thing down flat.

“Noooo! Take the peanut butter out of the jar first!”

Hand dips straight into the jar and smears it on the bag of bread.

“NOOO!!!”

Several attempts later, a weird, dilapidated sandwich emerged from the chaos—peanut butter on all sides of smooshed bread, jelly oozing out the cracks. Impossible to eat without a fork.

Other than my intrinsic love of trolling my own family… why did I do this? Because the kids had to actually stop and think about what they were saying. They watched their logic play out, debugged it, corrected it—and tried again. And again.

Sure, I had to throw out the bread bag, and someone licked peanut butter off a jar (and the counter), but we laughed and learned about coding. 

Hold up… learned coding? I mean, you read the subject line so I’m sure this wasn’t really a surprise to you, but just pretend it was. So what exactly did they learn?

1. Sequential Logic

It takes skill to explain things without assuming someone will “get” the missing steps. Computers don’t have common sense—they do exactly what you say. This kind of clarity helps kids think like coders (and project managers, honestly).

2. Debugging

Give instructions. Watch the result. Find the bug. Revise. Try again. Sound familiar?

3. Algorithms

Let’s de-mystify this word. An algorithm is just a set of steps to solve a problem. If your kid just wrote one to make lunch? That’s a win.

So the next time you make a sandwich, fold laundry, or kick a soccer ball, ask your kid to explain how to do it—step by step. Then follow their instructions exactly.

Chaos will happen. And so will learning.