My two oldest children are probably ready to start learning to program. Basil spends too much time on the computer playing games, but thankfully they’re more strategy games than anything else. Ginger doesn’t spend as much time, but might find it iteresting. I know they’re both capable of learning something. So, I’m going to use this weblog entry as a place to store different ideas I have have come across. Right now, I’m leaning toward a Lisp derivative. Lisp is clean and simple. “But you’re kids will hate it! There’s nothing practical they can do!” you say. Wrong! I’ve pretty much decided I want to use DrScheme to teach them. I was leaning towards Lisp (for its clarity, simplicity and cleanness) before reading his post on “Teaching my kids to program”, but after I reading that and his next post on the topic — “It’s down to Scheme or Logo” — I’m convinced to go with DrScheme. (FWIW, Don’s posts set off some really interesting discusson over on “Lambda the Ultimate.) There are other issues. I need something that runs on Linux and DrScheme does. It has a nice gui that includes the text to How to Design Programs, and Lisp runs on Lego Mindstorms which is also important since it will be good for kids to have a tangible result from their programming. Of course, some will say “Are you sure you want to teach your kids programming?” but I’m not really trying to give them employment options, I’m trying to exercise their analytical thinking skills, give them a good introduction to the use of logic, and maybe, just maybe, some fun. I’m not sure how age-appropriate all this is, but it looks like there are a lot resources available for this tact at Teach-Scheme.org. If nothing else, they’ll be good resources for me to use as I
It depends on what Basil wants to program
Your choice of language should also depend on what he wants to program. I can assure you that he’ll be far more interested in programming something interesting to him instead of something that feels like homework.
If Lego Mindstorms uses Lisp, then that’s likely all the motivation he needs. Games are always fun: Hangman would be possible in any language, although probably easier in Perl than in Lisp.
There might also be a game engine that uses some simple language to do what he would like. I remember Activision putting out something like this for the C-64 a long time ago (Game Construction Kit, maybe?), but I don’t know if there’s anything like this today.
Re: It depends on what Basil wants to program
hangman… I just finished reading the latest Harry Potter in which there was a magical Hangman set where a tiny wooden man would walk up to the gallows. Programming that with Lego Mindstorms would be really cool.
basic
if basic was good enough for me on my dad’s TI-994a then it should be good enough for Basil… ; )
Re: basic
Jim, Jim, Jim….
Nobody does Basic any more! 😉
Of course, there is no truth to that statement whatsoever. Look at Visual Basic and VBA in Excel…
Haskell or Python
I think it is great to start with a functional language. I think there is a lot of misperception about them out there — a lot of veterans of non-functional languages think functional languages are “hard” just because they are “different”.
I personally believe that functional languages come the closest to being intuitive that we have. It’s easy for us humans to “think” in the terms that a functional language does. Sometimes difficult for imperative programmers, because they have to unlearn all the rigors they’ve been going through, but a new programmer won’t have that problem.
Haskell has been particularly intriguing to me of late, with its very nice syntax, type inference, etc. I think its syntax would be more welcoming to a young programmer than Lisp or Scheme. It can also be compiled or interpreted, which is nice for experimentation.
Haskell even goes a step farther with laziness. I really cool feature to me, but perhaps you could explain it as, “You teach the computer how to do things, and what things mean, and then whenever it needs that knowledge, it’ll remember.”
For a non-FP language, I think Python is a good way to go. While Python is OO, and does have features that are neither clean nor simple, none of that has to become apparent right away. You can write very useful tools in Python without ever learning about OOP, and most of the rest without knowing much about OOP. If you say that “.” means “do something to”, that will get you most things.
Like FP, I don’t think that OOP is fundamentally more difficult than non-OOP paradigms. *If OOP is done right*, then it stays out of your way until you need it. Java and C++ don’t do it right, IMHO.
Unlike, say, Java, with Python, things that should be easy are, and don’t require much complexity to accomplish.
I would never suggest Perl or Java for newbies of any sort. Perl has so many special cases that it would just be overwhelming for a newbie. And Java makes even the most simple tasks complicated. (Try to figure out how you read a line of input from the keyboard and you’ll see what I mean.)
Finally, while you’re teaching them about programming, make sure you teach them about how computers work. What does an operating system do, why do you run Linux, how do networks work, how do disks work, etc. Wouldn’t hurt to talk a bit about free software philosophy either (why is Linux free)
Bottom line, though: I think your idea of using Scheme is excellent. I’m just pleased you weren’t gravitating towards Basic or Java 😉
— John Goerzen
Re: Haskell or Python
Thanks for the thoughts. “If OOP is done right” looks like Squeak might be OOP done right. In fact, Simon Johnston talks about teaching his 6-7 year old about programming using its GUI to race cars. And there is Powerful Ideas in the Classroom book that looks helpful.
programming
Honestly, depending on age, my first suggestion would be HTML/CSS and then javascript. Mostly because with HTML there is instant gratification. JS also is easy to pick up the basics and will lead to more instat gratification. There is also a chance with CSS and JS to teach them simple OO concepts, and for them to make pages that “do things”. Plus you can buy them each their own domains and teach them how to update thier pages. In this way they can go to school or otherwise tell friends, “Hey look at basil.hexmode.com, I made a page that says ‘you are poo!'” 🙂 Or is that just me?
Re: programming
Well…. I really wouldn’t encourage him to say “you are poo!” to anyone, but beyond that the idea of setting up a website is good.
Python has PyGame…
I’m a big believer in letting the application drive the language. So your “Lisp because you can run it on Mindstorm” argument makes a lot of sense, but I’d toss Python into the mix because it has PyGame.
I can recommend Gamemaker http://www.gamemaker.nl
School site:
http://online.haileybury.vic.edu.au/sites/edrington
More resources:
http://www.freewebs.com/schoolgamemaker/
Popularity
Some of us don’t have to worry about getting that many hits. 🙂