3 ms·
A long time ago, I saw someone else's brilliant answer to a similar question, so I will repeat it here. All you need is paper and pencil for your students. The
by anonytrary 9y ago
A long time ago, I saw someone else's brilliant answer to a similar question, so I will repeat it here. All you need is paper and pencil for your students. The idea here is to focus on concepts, not code:
Ask them to write down all of the steps required to to make a peanut butter and jelly sandwich. For example, a student may come up with the following solution:
1. Get the peanut butter and jelly.
2. Spread on bread.
3. Put other bread on top.
As the instructor, you must "break" their solution with a funny skit (as opposed to being pedantic). Try to do step 1 in front of the class: You flail your arms around like an absolute madman, reaching for the peanut butter, but you cannot reach it. Eventually, the students realize step 1 isn't clear enough for you. They come up with:
1a. Walk to cupboard from table (i.e. the peanut butter is stored somewhere; we need to go there).
1b. Pull out peanut butter and jelly (we need to acquire the goods).
1c. Walk back to table.
If you think about step 1b, you can see a potential problem if your hands are full. So, you proceed to get the ingredients with full hands, only to drop the jelly on the way back to the table; you didn't have enough free hands to get the jelly! At this point the students are facepalming you, which is good, and it encourages them to be even more explicit in their instructions; perhaps they include a check to make sure your hands aren't full before getting the ingredients.
This comedic, adversarial process between the students and the teacher continues until the students land upon an imperative, explicit way to make a peanut butter and jelly sandwich. Breaking down problems into imperative, unmistakeable steps is exactly the kind of skill which is used in programming, as computers lack linguistic pragmatism.
The lesson here is that computers are dumber than we think, and programming is the art of making them smart. The instructor plays the role of a dumb computer acting out the students' instructions. The students quickly get the point: their instructions aren't good enough for a computer, even if they are good enough for a human, and it's not that hard to be explicit if you take some time to think about it!