Teaching Programming

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 teachplay with them. Now, why not Java? BlueJ looks like a nice tool, but Java is Object-Oriented from the ground up. Like Don Box, I’m not comfortable with teaching OO to kids that young. For the same reason, I’m not going to go with Python or Ruby. How about Perl? I’m a great Perl programmer and I love the language, but I really do want to stick with something clean and simple. Finally, there are just a ton of resources available for teaching Lispish languages that don’t seem to be available for the other languages. I’m sure that this is partly the result of the reverence acadamia has for Lisp, but it also makes things a little easier. That, and Lego Mindstorms. What language would you teach your kids? Or, if you don’t have children, what language would you recomend?

12 thoughts on “Teaching Programming”

  1. 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.

    1. 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.

    1. 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…

  2. 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

  3. 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?

    1. 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.

  4. 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.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.