Teaching Kids Programming

For the last two years I’ve taught a computer club at the local primary school. I’d get six or eight kids aged 8-10 for two hours at a time, once a week for three or four weeks. They varied in previous experience from “have computer at home and play games on it all the time” to “Mum doesn’t believe in computers”. Last year I wrote up my experiences from 2006, and what follows is my summary of the 2007 club.

I repeated some of the same exercises as the first year (building stop-motion animations) but the big change this year was that I introduced Scratch instead of Lego Mindstorms. Executive summary: it was a great success.

The Lego Mindstorm kit hadn’t been a straightforward win for me. On the positive side, the graphical programming environment worked well. Kids are not good at typing. They were able to grasp loops and conditions and so on, without ever having to struggle with parentheses or indents.

Against that, though, we discovered into several significant problems. The hardware isn’t of high enough quality—tracking a line across a sheet of paper sounds like a great project but the light sensor wasn’t able to reliably do the job. Kids need strong positive feedback when they get it right, otherwise they rapidly lose interest. The compile-install process was a downer for them (added complexity with no benefit). The range of projects possible with the hardware in the box wasn’t exciting enough to maintain their attention over the long-term. They like the idea of a robot, they’re not so excited by the reality of it.

I had much more success with Scratch. The kids got quick successes from moving drawings and bouncing them off the sides. They learned the same concepts as were in NXT, but got to do more things they could relate to. They made sprites have conversations with one another (using the kids’ recorded voices), built games, and were constantly calling each other over to say “look at what I did!”. A girl, whose parents firmly don’t want a computer at home, built an animated summary of the first chapter of her favourite book. Boys wanted to make guns that shot bullets.

I think there’s a lesson here: doing something in hardware isn’t automatically cool, particularly for kids. It’s harder to make things happen, so we veteran geeks get a thrill from it. We think that because it’s physical, real, and a Robot, kids will automatically be excited. But for kids who are learning, and who don’t appreciate the significance of the challenge, it’s just hard and unrewarding.

This might change with age, but I think that even 15 year olds should have had some exposure to programming in software before they start on the hardware. The only way around that would be for the teacher has a huge toolbox of peripherals to bring in and make some more impressive demos than LEDs blinking and Legos rolling back and forward across the floor.

I’ve posted a longer report, including the non-programming bits of computer education that I did with the kids, on my personal blog. (updated to fix URL)

tags:
  • http://www.cookwood.com Liz Castro

    at… at…? This sounds really interesting, I’d love to read more about it on your blog… can you give me the address?

    best,
    Liz

  • DeadParrot
  • turn.self.off

    “A girl, whose parents firmly don’t want a computer at home, built an animated summary of the first chapter of her favourite book. Boys wanted to make guns that shot bullets.”

    there is a whole lot of content to ponder in that short bit of text…

  • adm

    I’ve taught both, too. You can get kids, even very young ones, going with Scratch in 5 minutes. Lego Mindstorms takes longer, but I usually use it to emphasize scientific method more than programming, since the “IDE” for Mindstorms was so clumsy.

  • http://radar.oreilly.com/ Nat Torkington

    @Liz Castro, @DeadParrot: Whoops! Thanks for the catch. Yes, that was the URL. I’ve updated to fix it.

    @adm: Yes, the lower bound for use of Scratch appears to be related to “can you read?” My 5 year old girl loved Scratch as much as my 8 year old boy, and was able to do as much with it.

  • http://www.bwebcentral.com/blog BradDet

    This reminds me of when I taught my younger brother how to program in BASIC. He was 7 or 8. I remember trying to explain variables to him using pices of paper and cups. (The cups being the varianbles and the paper being the values inside the variables).

    Definitly will check out Scratch when my kids get a little older (or whatever the latest think is in that time)

  • http://openlogic.com/blogs/author/stormy/ Stormy

    Hi Nat,

    Thanks for the write-up. I’m glad to hear that because I was thinking I’d have to get interested in Lego Mindstorm to introduce my 7 yr old stepson to programming. And while I think robots and hardware are cool, it’s not something I really want to spend weekends on. Programming on the other hand …

    FYI, we have an OLPC and he loves it. The one issue is that all the other adults in his life have a hard time using it and tell him it’s “broken” when they can’t get something working the way they are used to. For the most part he’s now able to show them it’s not broken but we had a few “arguments” where he insisted that that wireless was broken because so-and-so said so.

    Stormy

  • http://www.phrogram.com Jon Schwartz

    Have you checked out Phrogram? It’s version 2 of what literally starting in 2006 as the Kid’s Programming Language.

  • http://www.unvc.org Avi

    Hi Nat,
    I totally agree. I have being using Scratch from last September teaching kids at a school here in Israel and the results are great. We are working in a multi age setup and kids get it very quickly, teach each other and are having a lot of fun. I think Scratch really lowers the barriers to creating stuff while actually programming, and this opens the programming domain for more kids. Actually together with additional entrepreneurs here is Israel, we now think of how to try to use Scratch to get kids from less fortunate areas in Israel to know more about creating stuff with computers.
    Avi.
    http://www.unvc.org

  • http://radar.oreilly.com/ Nat Torkington

    @BradDet: When I was learning, I always was told to picture postboxes. That worked really well when I got to memory, where it was numerically addressed. There’s something magic about that offline system of development, too–old school programmers rave about the value of being able to execute the program in your head, rather than relying on the computer to do it. I got a great story from an Indian CS professor that I’ll post later if he lets me, about exactly that.

    @Stormy: Our family use Scratch as a game, now. The kids will ask to be allowed time on the computer to play with it. Watching my child create something–decide what should happen and make it happen–makes me very proud.

    @Jon Schwartz: I haven’t tried Phrogram, but thanks for the recommendation. I use a Mac, so Windows-only software isn’t much good for me. One of the good things about Scratch is that it’s cross-platform so the kids can work on their projects at home and at school, regardless of operating system. I encourage any readers who have used Phrogram to leave comments telling us what they thought.

    @Avi: It sounds like you had a great time teaching programming! I’d love to see Scratch become a standard component of primary school education. You said the kids were “teaching each other”, and that’s one of the key things we try to bring out at the school–when you discover how to do something cool, share that knowledge with the others. It gives kids a sense of ownership of the information, rather than “old dude at the front knows everything and stupid me can’t remember it all”.

  • Dom

    Sounds great – our school teaches kids Powerpoint in computer class. Terrible example of what you can do with computers.

    Have you looked at Hackety Hack?

    http://hacketyhack.net/

  • http://radar.oreilly.com/ Nat Torkington

    @Dom: again, Hackety Hack isn’t out for the Mac yet. I can’t wait to give it a try when it is!

    The school also teaches Powerpoint (Keynote on the Macs). Interestingly, they use it as a very easy page layout program for posters. Thankfully they aren’t teaching kids to give seven bullet points-per-page presentations (or, worse, seventeen).

  • http://www.systemsthinker.com/ SystemsThinker

    This is really cool. It sounds like you run into issues with kids not having developed great delayed gratification skills yet. They tend to want immediate results for the most part I imagine to keep motivated.

    Interestingly, I have read about a study done where they put some marshmallows on kids’ desks and told them if they didn’t eat it in a certain amount of time they’d get more of them. The kids who were able to wait – to display delayed gratification – had better outcomes on some other important measures later on.

  • Charlene

    Many years ago I helped teach a class on Logo using Apple IIs. The first batch of kids were the smart kids and the next batch were the kids who were below average in coursework. I think the second batch had more fun with making the turtle move around than the first. It also helped them with their self-esteem and increased their grades.

  • http://www.srcf.ucam.org/~dmi1000/roboc/index.html David Ingram

    Hmmm, interesting.

    If you wanted to transition kids onto a text-based programming language at some point (without all the mucking about in real languages like Java etc), you might like to try ROBOC:

    http://www.srcf.ucam.org/~dmi1000/roboc/index.html

    This is a project I started to teach kids (usually aged 13-16) how to program. Graphical programming is great but I wanted something a bit more like BASIC. You do need a Linux machine to try it out though (fortunately our University has classrooms of dual-boot machines). We’re aiming to get kids interested in programming before they are put off by the routine uses of computers (spreadsheets etc) which is all they usually see in school.

  • http://edtechdev.blogspot.com/ Doug

    I would also look at Computer Science Unplugged for some ideas: http://csunplugged.com/

    The average age of people using Lego Mindstorms is over 30, so that should be a clue it’s not the best learning environment for kids.

    I would be cautious about other “languages” recommended, too. Phrogram is basically a stripped down visual basic .net. Hackety hack is basically ruby, which never was designed for beginners or kids, same with python.

  • http://scratch.mit.edu Andres Monroy-Hernandez

    Thanks for sharing your experience with Scratch. It is interesting your comparison of software vs hardware.

    One of the things we’ve found is that while building robotic creations can be incredibly appealing to some kids, it can also be quite narrow.

    I wonder if your kids could have reacted differently to hardware if it was more open ended and not “just” about robotic inventions.

    Have you looked at the hardware extension of Scratch: the PicoBoard?

  • http://www.cymonsgames.com Joe Larson

    I heard about scratch when I was a teacher, tho the program we had at our school mandated using a different package, Greenfoot. I wasn’t impressed by it either of them, actually but I have a somewhat different philosophy about visual development environments. I don’t like them. Never have since Logo.

    My opinion is teach them using something that they can actually use outside the class. Don’t treat kids like they’re too dumb for the real thing. I may be wrong about that, but it worked when I learned programming in my younger days. Of course I was learning BASIC, but BASIC made real programs. Not the most robust or impressive, but as real as some professional programs of the day.

  • http://roorky.com PK

    Interactive Programming Books might be good ideas to kids to start with programming. Roorky has come up with a new format iPUB for interactive programming books. Please checkout at http://roorky.com. Code snippets can be executed or edited right when you are reading the book.

    PK
    http://roorky.com
    Interactive Programming

  • http://Http://ramblingteacher.blogspot.com Rambling Teacher

    Thanks for this post, Nat. I have recently begun teaching Scrarch to some year 7 students and most are enjoying it. I too have noticed that girls (I teach at a girls school) prefer animating stories to computer games.

  • Carl Smith

    Phrogram is trialware, based on .NET, and only runs on Windows, itself a terrible piece of software to use to learn or teach programming.

    As for Scratch, its pretty rubbish too. It’s just not a programming language in any normal sense of the term.

    I think it’s easy enough to teach a subset of Python3, that’s powerful enough to learn all the basic concepts and then extend it as you go along, chuck in new concepts and language features, use some frameworks, learn a bit of HTML and all that.

    How much Python do you need to know to learn to program?

    ints and floats
    expressions and variables
    strings of text
    lists
    functions
    objects
    methods

    With IPython set up right, you could skip functions altogether and just define the world you’re in as a single instance of a World object. World has methods, really just builtin functions, and you can add more World.methods(), analogous to user defined functions.

    You can’t teach informatics with a stupid, cartoon cat. These kids are a lot smarter than people give them credit for – let’s give them their due, not dumb them down.

  • Matt

    I agree that Python 3 is a good programming language for kids. I have evidence. I am 12 and I love python. I started learning it since i was 11.

    I also used to use scratch, but the lack of object-orientation and a text output console kind of killed it for me.

    If you know someone who likes scratch, try introducing the to scratch BYOB (byob.berkley.edu). It has some elements of object orientation and the ability to define functions.