Think Like a Programmer
Programmers turn a goal into clear steps a computer can follow—and then debug what happens when those steps fail.
The Challenge
Write instructions for a robot to make a peanut-butter-and-jelly sandwich. The robot follows directions exactly and cannot “figure out what you meant.”
How a Programmer Thinks
- Decompose: Break a big task into smaller parts.
- Sequence: Put the steps in the correct order.
- Pattern: What actions repeat?
- Condition: What should happen if something is different?
- Test: Follow the instructions exactly.
- Debug: Find where the instructions fail and change them.
Your Turn
Write five to ten instructions for the sandwich-making robot. Then have someone follow them literally. Where does the “program” break?
What Did You Notice?
Which instructions depended on knowledge you assumed the robot had? What needed to become more precise?
💡 Funky Tip
Debugging is not proof that you are bad at programming. Debugging is part of programming.
Where Else Could You Use This Thinking?
Recipes, routines, robotics, directions, systems, troubleshooting, math procedures, game rules, and any problem that can be broken into logical steps.
🎒 Take It With You
Break it down → sequence → test → debug → improve.