It’s not what you think. It’s not “when do you introduce objects?” Nor is it “which language?” or even “which approach?”
Nope. As a teacher for all these years I’ve found the hardest thing about teaching programming is coming up with the right problems. Lets face it – the bulk of problems and examples in almost all programming texts are just awful. They tend to be simpleminded, boring, obscure, or just plain lame. We’re all sick of the dreaded “hello world” first program. When I titled my last PyCon talk “Goodbye hello world” I got a reasonably full room, probably largely because of the title.
Not that I’m free of blame either. I’ve assigned the various calculators, cash registers, math functions, etc. right along with everyone else. Because they need to do something and it’s hard to come up with problems that are at the right level of difficulty, illustrate the concept being taught, and are interesting, engaging and fun. So we just do the best that we can and hope to get through before the boredom sets in.
Of course, I’m being a bit sneaky here. I’m hoping someone will read this post and refute me by posting a bunch of boffo exercises. That would really teach me…😉
I have found a few problems/projects that I thought did work well, so let me get the ball rolling:
- Conway’s Life – great for several things, including 2-D arrays, simulations and timesteps, even objects. Kids can find it fascinating and every time I assign it, at least one kid gets completely wrapped up in it.
- graphics and animation – in Python the Livewires library makes animation pretty easy, and kids have enjoyed making things move around the screen. They also are learning looping and branching at a minimum, but they don’t seem to notice.
- turtles – replacing “hello world” with some simple turtle graphics has also worked well. And the sequence of movements makes the idea of a program as a sequence of instructions clear from the beginning.