Friday, January 9, 2009

Teaching Kids Programming (and other things, using programming as a vehicle).

Freeman Hunt asked about introducing a kid to programming.

I always wanted to do my own programming language and educational setup. Ironically, children tend to interfere with the whole "free time" thing so, it'll have to wait for grandchildren I suppose. This blog, I hope, will help others the way Ahl helped me.

In any event, it's hard to beat Smalltalk as a layered system.

First of all, there is Squeak's E-Toys. This can be found on the XO laptop--the $100-ish device they send to poor kids. That project is a realization of Smalltalk creator Alan Kay's dynabook. If you don't know about Alan Kay and the Xerox PARC crowd, well, you don't know about the history of computers. They're the guys Jobs ripped off for his Mac. Kay coined the term "object-oriented programming". I could spend some time on the rest of the crew (Dan Ingalls, Adele Goldberg, etc.) too, but we'll stay focused.

E-Toys isn't really about teaching how to program. It's meant to make the exploration of ideas simpler. Like, after teaching about gravitational acceleration, you could have the kid model its effect on various items. They'll learn about basic programming concepts along the way, but Kay's vision is broader than teaching how to program. (In fact, listening to him, one senses the dissatisfaction Kay has with software development and wonders if he doesn't worry that some new, better paradigm for development might be crushed in some young mind by current ideas.)

In the "not quite programming" category, there's also Sophie, which is a multimedia authoring tool written in Squeak. (Though apprently be rewritten in Java for some reason.) Scratch is also written in Squeak.

For The Boy, I found that he wasn't well suited to E-Toys visual approach. And he was frustrated by E-toys' limitations. In other words, he was focused on programming as an end. So, when he was able to read well enough, we used the book Squeak: Learn Programming With Robots. (I'm pretty sure Stephane has open-sourced and freebie-ized the book recently, but I like having the hard-copy anyway.)

He jumped quickly from there into straight Smalltalk (Squeak) and has been living there until now. He wants to make games, though, which you can do in Squeak, but in modern times makes more sense to do in Flash, so he'll be moving into that area this year.

I knew this time would come, but I think teaching Smalltalk first was the best approach.

Freeman asks: What hardware, software, operating system, books, etc.?

Well, hardware-wise: None. 30 years ago, the guys at UCSD figured out that if you wrote to virtual hardware, you could save a lot of trouble. This didn't work out then, because writing to a virtual machine results in slower code, and there just weren't the cycles to spare. That's increasingly less true, to the point where even code written for cell phones is virtual.

So, forget about the hardware. As Instapundit pointed out the other day, the "netbook" thing is likely to break the Intel stranglehold on the "desktop" computer.

Forget about the OS, too. The netbook will kill that, too. Microsoft has finally realized that the next platform is the virtual one, which is why they're busting their hump to get Silverlight into a usable state. Silverlight is, in essence, Flash.

Does that mean a kid looking to be savvy ten years from now needs to learn Silverlight and Flash? No, not really. What it seems to foretell is that the future platform is the browser. Microsoft lost the browser wars to Firefox--not to say that people don't use IE, but enough people use Firefox that MS can't force it's "standards" on the world. So the next battle is for the virtual machine.

And it's not just between Silverlight and Flash. Every browser has a built-in Javascript machine that has been advanced aggressively by companies like Google. However, since MS must implement that machine in IE, it's in their interest to screw it up, especially now that they have Silverlight.

And the thing is, whatever is going on now is very likely to be irrelevant ten years from now. So what anyone needs to learn is the basics: the core mechanics haven't changed since my dad's day and most modern in-use languages are object-oriented, so that leaves you with needing a platform in which you can learn about design issues like refactoring, patterns, testing and so on.

Squeak happens to do all those things very well, and because it's both a development platform and an experimental one, it tends to do whatever new thing comes down the pike before anything else.

Squeak is free and runs on nearly everything. The Boy has been using it on a ten year old machine that has Ubuntu on it. A machine of that caliber will run $5-$10, if you can find one.

The only downsides are that Smalltalk is the deep end of the pool and Squeak is ridiculously dynamic. There's always stuff going on, and that can make learning about it difficult. It's completely open by nature (Smalltalk was designed that way), but it can be like staring into the impenetrable void.

So, you very much want to get as much as you can out of E-Toys and Robots and all the others before diving into the Smalltalk proper. And when you do get in that deep, you want to get on the Squeak beginners list.

The Boy started out needing a lot of help and gradually got to the point where he could work most things out by himself, within a year or so.

And that is, essentially, what you're going for.

4 comments:

Freeman Hunt said...

Thanks, Blake. Extremely helpful.

blake said...

You're welcome, Freem.

Let me know if you need any more pointers or just outright help. It helps tremendously to have a resource.

Freeman Hunt said...

I downloaded Etoys to take a look. Wow! I'm impressed.

Now my only problem is that everytime I get anywhere near my computer, my almost two year old son requests, "Neat car again? Neat car again?"

blake said...

It's a good tool to have in the belt.

You can really give a child a good understanding of scientific principles with it.

Followers