Best computer language for a beginner

Tuesday 6 November 2007This is 17 years old. Be careful.

Philip Greenspun asks “What’s the Best Computer Language for a 13-year-old Beginner?” and gets an awful lot of responses. Many of them seem to totally miss the mark about how to introduce kids to programming.

In my experience, you have to keep a number of things in mind besides programming languages.

First you have to find out what fascinates the kid in question. Do they want to make a video game? Do they think expressing themselves in a web page is cool? Do they want to pull data from the web and manipulate it somehow? What sort of application would be interesting to them? Some kids are fascinated by programming itself, but most are only using it as a means to an end, and you need to know what that end is to keep their attention.

Next, there are many things that you and I don’t think of as programming that are still programming in the kid’s mind. Creating an web page in HTML is programming. Selecting the correct options in a constrained game editor like RPG Maker XP counts as programming.

To a kid who’s never told a computer what to do before, any kind of direction that the computer will follow counts as programming. It may not have loops, it may not involve typing, but they still have to:

  • decide what they want the computer to do,
  • understand the tools at their disposal,
  • create the instructions,
  • try out what they did,
  • and figure out what’s wrong when it doesn’t come out right.

That right there, that’s programming.

The last thing to understand: how much help will you be providing? One way to get kids going is to do most of the work yourself, but then give them a very simple control to play with. I wrote a simple video game once, and then showed Max where the initial number of aliens was set. He could change the value from 10 to 50, and see a dramatic difference in the game play. It was eye-opening for him even though he was too young to be able to make substantive changes.

If you are going to help a lot, then you either have to choose a language you already know, or are willing to learn yourself. If you aren’t going to help a lot, then you have to choose a language that won’t need a lot of help. This sounds obvious, but your time commitment is often the toughest variable to get right, so think carefully about it.

All that said, I think there are some interesting unconventional choices for where to start kids with programming:

  • Flash: the big advantage here is that you can start by simply making key-frame animations, and then graduate up to Actionscript in small doses. Also, kids have probably already been exposed to tons of Flash content, and so have good cultural understanding of the types of thing they can build with it. Downside: expense, though I had good success with buying a copy a few versions old on eBay, and Academic Superstore will sell you an educational license.
  • Scratch is a tile-based visual programming environment. The results can be a little crude by Flash standards, but it’s a very nicely made environment. Actions are expressed by clicking tiles together, so there’s no syntax errors to stumble over. Some of the example projects are quite impressive. One nice detail: the layout of the tile code almost resembles what a textual programming language would look like, so it’s a good stepping stone to more mainstream environments. BTW: MIT also has StarLogo TNG which also uses the tile metaphor for building programs, and uses a more ambitious 3D environment, but seems not quite finished.
  • RPG Maker XP is a game editor for making tile-based games like the original Legend of Zelda (I think). The graphics are all created from a large set of tiles, so it’s easy to make environments that look reasonable, and all of the “coding” is done my making choices in dialog boxes. Enormously complicated dialog boxes, but at least there’s no syntax to learn. Max downloaded and figured it out himself when he was 12 or so, and now he’s taught Ben (now 9) how to use it, so it’s approachable, even though I don’t understand it at all. There’s no real path up from there, though, so this is only good if the child in question wants to make RPG games.
  • HTML. Don’t worry that this isn’t a programming language, and don’t worry about all the CSS form-vs-content stuff. Your kid will probably be thrilled by <font size=7 color=red> and will have his first taste of where the red pill can take you.

In the conventional languages arena, there are good attempts to bridge the gap from kids to code: Hackety Hack is a tutorial and programming environment for Ruby, and RUR-PLE is a robot simulation using Python.

Whichever tool you choose, remember: they’re kids. Don’t make the mistake of treating them like short adults. They aren’t starting a career, or building a resume. It doesn’t need to be bullet-proof, it doesn’t need the latest theoretical underpinnings. Give them the answers when they are stuck.

Just make it fun.

Comments

[gravatar]
Ned, you mentioned Hackety-Hack but didn't mention WTLS's other project Shoes that's designed specifically to be entertaining to build things with.
[gravatar]
Game Maker is very easy for kids (I tried it on my own :-) ) and fun. You can create many types of games, like invaders, platforms, etc., with simple GUI and placing "icons" to "trays" to define activities - more intuitive than writing the code.

Even if game is not as professional looking like commercial games, kids appreciate that you can go in and change whatever aspect you want.
[gravatar]
I love your reminder to not treat kids "like short adults". And your description of programming:

* decide what they want the computer to do,
* understand the tools at their disposal,
* create the instructions,
* try out what they did,
* and figure out what's wrong when it doesn't come out right.

is right on. Helping them learn to think algorithmically is the best thing we can do, imho, whether or not they ever become "programmers".

Thanks for the great suggestions.
[gravatar]
I wish that Bioware would make their Neverwinter Nights game available at some point. That's one of the best toolsets I've enjoyed for game development.
[gravatar]
I completely agree that this has to be application driven - even if a kid is interested in programming itself, they will get a lot more out of writing a video game than a database application no one will use (how many of us would enjoy writing business software no one will use? How many of us have a 1+GB SQL database at home).

I disagree with the comment on treating them as short adults. I have always been impressed with kids ability (even younger than 13) to pick up technical knowledge, and personally feel the average kid with no programming experience learns a lot better than the average adult. I say get them started right away with C# or Java (general programming) or even C (good if they have access to linux) if they have any interest.

I learned by being asked to solve simple problems (given 2 angles and a side of a triangle compute the other angle and sides). I wasn't 13, I was 16, but still a good way to learn.

I also say stay away from heavy lectures on commenting code, readability, modularity, etc. I question what good it does college freshman (it does not improve their code), it only makes people not enjoy coding.
[gravatar]
You should check out some of the products by Clickteam: http://www.clickteam.com/
Games Factory was my first programming experience as a 13-year old. Very simple and easy to learn yet quite powerful. Free demo versions are available at the website.
[gravatar]
Everyone: thanks for the great pointers to other tools. I'll be checking them out.

Brad: when I said "don't treat them like short adults," I didn't mean that they couldn't learn a lot, just that kids need different things than a college student learning a language, or a junior engineer learning a third language.
[gravatar]
Exactly! Kids need things that can hold their attention and is above all fun.

RUR-PLE is a nice environment. I also like Alice - http://www.alice.org/
[gravatar]
Now, you know I have at least a small disappointment in the lack of any mention of Python. I do, however, really enjoy the approach you took here. I am still waiting for my son to be old enough to ask me about this. He love's clicking the mouse around and pretending to type. He'll be a year and a half in a few weeks.
[gravatar]
Give python or ruby to your kid if you want him/her to hate programming for the next 10 years.

Try Alice or Scratch or Processing or GameMaker.
[gravatar]
This is a great post and a very "user-centric" way to think about education and programming.
[gravatar]
I'd prefer if you didn't think of 13 year olds as "kids" that have to be treated specially in general. Myself and some others started programming at that age and although I am a bit on the uncooler side of starting with Turbo Pascal and Visual Basic whereas others hacked their C64s and started directly in C, I don't think I did anything too different from a grown-up starting.
I mean, good if you are actually in the position now to bring some knowledge to your kids, but at least back then most of us taught our parents to use the computer.
[gravatar]
How about this: I should have said, "don't make the mistake of assuming you can treat them like short adults." Some kids are fine with a sophisticated approach to programming languages. Some are not. I think too many introductions to programming assume one particular outcome (a newly minted software engineer, ready for employment), when there are really a number of different endpoints for the study of programming. This is true for adults too, but I think it is especially true for kids.

So yes, some kids are fine learning the way adults do. As a matter of fact, it's the way I learned. But many kids are not. Know your customer!
[gravatar]
Remember that "kids don't want to be treated like kids", esp. if they are 13 yo :-)
My dad bought me a box of Turbo C when I was 11 or 12 after I had "hacked" a bit with MS Word (umm..). What I got was 2 books and an IDE and I loved it. It gives you the opportunity to try out things and kids are very well able to use general purpose tools to have fun. Likewise it's always more fun for a kid to play with a real hammer than with a toy one :)
So, please don't treat your kids like kids and give them a real hammer - it won't hurt.
[gravatar]
I learned on C64 Basic. You had to write values directly to memory addresses to get anything done. Not ideal. But I learned it anyway, aged 9 - why? Because the computer didn't do much otherwise. You switched it on, and you either sat there, or you started typing. In the days before anyone had computers, to make the letter X bounce jerkily around the screen was like magic.

All of these development environments mentioned are a huge leap forward over Basic - but how many computers come with them? How many parents bother installing them? And how many of them are more fun than just playing games?

For older children, the best route into programming seems undoubtedly to be the mod kits and level design kits that many games ship with nowdays - all the fun of the latest games, but you're making something yourself. I'd like to see more of these for younger children - simple games with simple mod kits and level builders.
[gravatar]
And what about Logo? ;) I recently attended a conference where a presentation on Logo was given (by one of the most intelligent programmers I've ever met), and after the talk, several people in the audience turned to be in fact school teachers with an experience - and overall good experience - of using Logo for education even today. And mind you, Logo is not just a child's toy: There is something deep in the language, what about its higher order functions and control constructs using first-class blocks of code?
[gravatar]
Actually the RUR-PLE is yet another variation of an old simplified imaginary robot programming language. There have been a number of "Robot" Languages over the years. I think RUR was the first one.The first one I encountered was from a book called "Karel the Robot" back in the 70's. You basically used simple commands to command a robot through different mazes and tasks(picking up and putting down beepers ) and and you could reuse and modularize your instructions to perform complex manouvres. Very engaging stuff!
I learned structured procedural oriented programming with it even though it was a paper/pencil exercise. I did eventually write a simulator based on Karel using Turbo Pascal on an old DEC Rainbow CP/M 86 in the early 80's as a project for school. Another more recent one is Squeak which is based on small talk. I think these Robot languages are the perfect answer to this question.
[gravatar]
well tbh learning c# was my first move... maybe the syntaxes are hard for a child but lets face it ''robot'' will not teach how to make as sophisticated programmes as ruby, c#, c++, c or woteva will...

Add a comment:

Ignore this:
Leave this empty:
Name is required. Either email or web are required. Email won't be displayed and I won't spam you. Your web site won't be indexed by search engines.
Don't put anything here:
Leave this empty:
Comment text is Markdown.