Teaching Kids to Code
Wednesday, April 13th, 2011A couple of chats recently - at North Staffordshire GeekUp and elsewhere - have turned to programmer education. My particular input to the conversation, reflected the same concerns I express in discussion over the male:female imbalance in Free Software projects, namely we need to enthuse people about IT early on.
In short, people are being turned off (or at least not turned on to) IT at an early age. Programming, and everything web, too, is creative. It should appeal in some way to nearly everyone.
Let’s get some real and fun IT education into Primary schools - don’t wait until it’s too late. I’d love to see playground games where kids take the part of bits moving through logic gates; 10 year-olds should be flowcharting how to program a robot to make a cup of tea; and kids - all kids - should learn how to program. It’s a skill that teaches valuable logical thinking.
Where to start on the programming? Naturally, every time a group of geeks discuss this there’s a mini language war, but choice of language makes a difference. Simply, don’t use a language that overwhelms: C is simple, but involves learning too much about computing for a 12 year old to dive in and start thinking about how to program; Java is just a mess, and too big.
I’d be fine with Ruby or Python, and perhaps a Lisp dialect like Clojure could be used - but now I’m reviewing Eloquent JavaScript, by Marijn Haverbeke [Kindle edition], & I think it could be adapted.
The big advantage with JavaScript is that every computer contains a runtime for it - and one with which most kids are familiar - the Web Browser.
The recent GeekUp thread on programming prompted me to try Fizz-Buzz in JS, and there’s little cruft in the language to stop you getting straight down to it:
<html> <head><title>Fizz-buzz</title></head> <body><script type="text/javascript"> var count = 1; while (count <= 100) { if (count % 3 + count % 5 == 0){ document.write("fizz-buzz"); } else if (count % 3 == 0){ document.write("fizz"); } else if (count % 5 == 0){ document.write("buzz"); } else{ document.write(count); } count += 1; document.write(" "); } </script></body></html>
So what do people think? Anyone interested in helping to write a course for 8 to 13 year olds to learn programming? Using JavaScript? Want to do it in another language? What should we teach and what should we miss out? Let me know in the comments…
EDIT
Please join the conversation at http://teachyourkidstocode.org/wiki/ as we try and get something going - all ideas welcome :-)









