Mark Guzdial is a provocateur. In today’s blog post, the title says it all: “teachers as provocateurs … all learning starts from a problem.” An example he gives is teaching students about loops because it will save them from having to cut and paste (or re-type!) code in the future. Instead, he suggests, let them do it the hard way until it becomes a problem for them, at which point the natural process of disturbing one’s equilibrium because it doesn’t work anymore will lead to learning about loops in a natural way.
I like this perspective a lot, but have found it difficult to use in practice. Part of the issue is my own unwillingness to give students the time and leeway to develop their own perception of the problem with writing repetitive code. To me, once a student types dozens of lines where a two-line loop would suffice should be enough to motivate them to learn a better way. But, in fact, not everyone has the same low tolerance for repetitive labor as I do. And I don’t have the patience to let nature take its course. There is only so much time available in the semester!
The other issue, of course, is that “beginning” coders come to the course with different backgrounds. Some already know about looping from outside experience, while others have never thought of the computer’s ability to automate mundane tasks, and accept typing nearly the same thing over and over as simply consistent with their world view of how things get done in the world. How to reconcile these different backgrounds?