One of the Biggest Challenges in Teaching Programming

May 26, 2007

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.

‘Learn Python’ Launches

May 26, 2007

Welcome. This is the inaugural post for a collection of odds and ends (probably mostly odds) relating to the process of learning (and teaching) Python. I’ve been programming for 20 years and teaching programming for over half that time, and a proponent of Python since 2000. I’m also working on an upcoming book on Python for a well-known series by a well-know tech publisher. (More of that later )

My hope is that this blog will generate some discussion and that it will be useful both to the readers and to me. There is a movement in education circles called “Writing Across the Curriculum” which talks quite a bit about the benefits of “writing to learn”. If nothing else, that should work.