Why Johnny Can't Program

Many months ago, David Brin (the author of many sf books and “The Transparent Society”) wrote a piece for Salon called Why Johnny Can’t Code. It’s about the disappearance of BASIC and the resultant inaccessibility of introductory programming. I was moved to shout “hear! hear!” when I read it, because I have been facing the same issues since I returned to New Zealand. I had a chance to do something about my frustration when my kids’ primary school wanted volunteers to run clubs for the kids: I stepped up and ran a three week computer club for two sets of kids.

Each class was four kids in size, a mixture of boys and girls. They varied in age from 7 to 10, and I had them for three 90m sessions over the course of the club. I structured the club to lead them into programming.

Week 1: Think Small

Programming is all about reducing big problems to small and easy tasks. So I paired up kids on two Macs I brought from home, and we used iStopMotion to build stop-motion animations. This teaches them to think in terms of small steps, while at the same time they become familiar with the computers. And, best of all, it’s enormous fun. I recorded (with Quicktime Pro) the kids doing voiceovers and stitched together movies. Over the following weekend I burned the movies with iDVD and the kids were able to show their goodies to their families.

Week 2: LOGO

In week two each kid took one of the school’s desktop PCs and we learned to program in Logo (MSWLogo to be precise, which I have mixed feelings about). I gave them cheat sheets of forward, backward, left, right, etc. I had them draw boxes and then regular shapes like pentagons and octagons. Advanced kids got to make smiley faces.

Week 3: Motion

I bought a Lego Mindstorms NX kit (much to the horror of my wife who watches my credit card activity like a hawk) and the culmination of the class was getting to tinker with the machine. I brought in a basic robot and they added sensors and new motors to it as I challenged them to make it do different tasks. I had only half the kids work on the robot at any one time, the others experimenting with Alice virtual worlds to learn object-oriented programming.

Overall, I think it went really well. I had three girls and one boy who were really keen on programming, which represented half the intake. Those kids now know (a) that they can do it, and (b) where to find more. Those who didn’t take to it at least know that it’s possible and it’s not hard (just detail-focused and sometimes not as much fun as running around outside). All valuable lessons.

I also learned lessons. First and foremost: only one Mindstorms kit isn’t enough! The kids could easily have spent all three weeks building and programming them. And even with a pair of kids on the robot while another pair were programming in Alice, the kids using Alice always felt like they were getting a raw deal. I didn’t have the discretionary spending for a second kit, unfortunately (as it was, the Mindstorms kit was “an early Christmas present” for my 7-year-old son that I immediately stole for the class).

I also learned that there’s not a lot of great introduction to programming software. I looked at Python and PyGame and Perl and a handful of Mac Logo interpreters and they were all too hard for seven year olds. Kids that age can type, they can use the web, they open and close windows, but saving and switching windows and remembering the #! incarnation and … all that crap gets in the way of teaching programming. It’s like making someone make their own paper before you teach them to read: yes, paper is important, but it’s not what the goal of the exercise is. David got it right when he remembered the simplicity of line-oriented BASIC programming.

The modern equivalent of BASIC is the interactive interpreter, such as the fabulous Interactive Ruby Tutorial. As the new guy on Radar, Gabriel Williams, pointed out in internal email, they’re primarily for debugging and prototyping, but they’re also excellent tools for learning a new language. My only problem with using these with 7-10 year olds is that the raw language doesn’t offer enough sexiness–graphics and video seem to happen at a low level and that makes it hard to inspire the kids to persist through the inevitable frustrations of typos, difficult math, etc. I think it probably is telling, though, that the only systems I found were open source.

Do you have a favourite first programming system for kids? I’d love to know about it–tell me in the comments.