I don’t want to create a dynasty of coders, but I’d like to get rid of their blank look they get when I try to explain what the heck it is that I’m doing there. So since there was not much exciting to do today anyway I set up the laptops in the living room, and knocked on wood theat they wouldn’t find the experience boring and nerdy.
My kids are ten and eleven years old; my older son hasn’t shown any interest in computers apart from gaming yet; my younger daughter has lately been experimenting with typing stories into Word (OpenOffice Writer, to be precise), organizing music in iTunes, and manipulating photos.
I wanted something simple, quickly rewarding, and graphical for starters (to avoid the boring/nerdy impression mainly). I had seen KPL some time ago, but it’s been converted to/absorbed in a larger product called Phrogram: it’s commercial now, there seems to be quite a good community support, but I found it a little hard to find out where Phrogram starts and where it ends. What I miss on their website is a clear vision statement – it’s got 3D and database support, a debugger, testing… without having evaluated it too closely, I’d say it goes a lot further than being an absolute beginner’s tool.
Then there’s Scratch, which looks great for creating interactive media and things like point-and-click adventures. Scratch has got a graphic programming editor that lets you react to events, cause things to happen, and use structures like loops and forks (“when the kitten is clicked, play a ‘meow’ sound, for three times”).
Scratch looks like a lot of fun and surely supports getting wild with. The gallery of what people do with it is quite impressive. I’ll certainly give it a go later.
The thing I finally chose was a MS research project called Small Basic, which is specifically targeted to beginners. It features a highly simplified programming language, and a nice text editor that offers autocompletion and ad-hoc help. What I found striking about it is that it lets you use different types of programs: console apps, which are still great when you want to play with command-response style things (like a calculator); 2D vector drawing for cearting games and: The Turtle.
The Turtle offers a Logo-style programming model: There’s a turtle sitting in the middle of your screen; you can tell it to move, and to turn. While it moves, the turtle draws a line. You can’t have it any simpler. So here’s how to draw a rectangle:
Turtle.Move(100) Turtle.TurnRight() Turtle.Move(100) Turtle.TurnRight() Turtle.Move(100) Turtle.TurnRight() Turtle.Move(100) Turtle.TurnRight()
In fact, that was the first thing I let my kids do, and they got it working within minutes, and were enthusiastic about the result (*phew*). Then I gave them a pencil-drawing of a more complex shape, and they got that working after some fiddling as well.
Then they started making some own drawings (including an accidental swastika – by copy&pasting parts of the shape above) and were having fun. Soon there were complaints about the redundancy of typing in the same line of code several times (“can’t I just make it repeat this?”, typing “Turtle.DoItAgain()”). Time to move on: enter the for loop.
For howOften = 1 To 4 Turtle.Move(100) Turtle.TurnRight() EndFor
wow! That went a lot better than I’d expected. Next time I’ll try to introduce variables to draw a spiral:
For howOften = 1 To 100 howLong = howOften * 10 Turtle.Move(howLong) Turtle.TurnRight() EndFor
BTW, Small Basic compiles into “real” exe files that you can show off with, and can be converted to Visual Basic.
I’m quite confident that the first programming lesson was some fun, and sparked some interest.