Ask HN: What programming languages to teach kids under 12 years old?
What programming languages would be beneficial for kids under 12 years old?
Links to resources would be greatly appreciated.
Kids(and anyone without the preexisting motivation to try the harder problems of programming, which would include most adults too) will want something with a lot of immediate responsiveness and simple failure modes. This rules out languages needing "build systems" of any kind, languages that require hooking up a "foobar library" to do anything but console output, and languages with obscure error messages and ample means of shooting oneself in the foot.
HTML/CSS mixed with a little bit of JS is roughly equivalent to learning BASIC these days - you can throw something on the screen quickly, and add bits of functionality from there. Since errors throw exceptions, they're pretty easy to understand, and with the newer HTML features there's tons of room to grow into different domains. Plus there's a zillion resources for JS coding out there.
A good alternative, if the kids in question are not old enough to care about the prestige factor of "real" languages yet(an issue as you get near the teen years), is Scratch: http://scratch.mit.edu/ It reduces syntax to drag-and-drop while retaining some key concepts that bridge the gap into more powerful languages(conditional branches, named variables, and list manipulation)
At 9 I learned Basic.
At 10 or so I learned Pascal.
My programming finally took off around 12 when I learned C and Assembler.
I think it's important to point out that no programming language is "too hardcore" (well, maybe assembler) for a generic 12-year-old. They can learn anything.
With that, I would suggest a combination of HTML/CSS/Javascript for the quick results and Ruby for the fun and elegance. Then let them learn whatever they feel like. If they don't feel an impulse to go learn this stuff by themselves after learning 1 or 2 languages, they're probably not interested anyway.
Scheme. Here's a good article on this very subject, and the benefits of Scheme as a learning language:
http://www.trollope.org/scheme.html
Linked from Paul Graham's essay Beating the Averages:
http://www.paulgraham.com/avg.html
In a nutshell, the advantage to Scheme is that there is almost no syntax for kids to get hung up on, they can jump straight into learning computing and solving problems.
And depending on how far they go with it, they'll learn some of the more powerful programming techniques like recursion and continuations.
The book referenced in the article is The Schemer's Guide:
http://www.schemers.com/tsg.html
Two other good learning books for children are probably The Little Schemer and The Seasoned Schemer.
Racket is an easy, free, open source environment to get started in:
or install the package 'plt-scheme' from whatever Linux distro you're using.
If I were 25 years younger I'd like to be introduced to Processing (http://processing.org/). I say that because my interest in programming developed because I wanted to know how how to draw interesting patterns on a screen; and I liked the mathematical aspects of that sort of program.
I think the answer in your case will similarly depend on the interest of the kids. Is the question for a general school class or for a few kids with particular interests?
Hackety Hack is trying to accomplish this: http://en.wikipedia.org/wiki/Hackety_Hack
Scratch[1], because its very easy, provides immediate feedback, is fun, educational and at the end of it they will understand fundamental programming concepts like variables, conditional statements and loops. Its also a visual language, so it will be immediately more appealing to kids than text, which is, lets face it, extremely boring.
[from the other thread] There's LOGO if you want to go old school with turtle graphics:
Something like a C64 would be nice. That's how I learned but I'm quite much a visual and spatial person. YMMV.
The C64 had a BASIC that is easy to learn, immediate evaluation for trying things out and failing fast, and direct control of various graphics (text mode, bitmap mode, sprites). And you could do all kinds of
Someone suggested HTML+JS but I think that a simple raster display is much easier to grasp than CSS layout or vector graphics. Pling: a pixel goes bright. Plong: a pixel goes dark.
First you want to have something on the screen and then you want it moving. Coordinates conveniently introduce you to numbers and basic algebra. If you want to do crazy things, you can POKE the hardware directly.
I can't think of anything this simple in 2010.
Well, if you want to get a kid hooked on programming, or at least grab his/her attention quickly, you should also keep the coolness factor in mind: how easy is to create something impressive and how you can promote some algorithmic and/or analytic thinking with it. With that considered, I'd suggest:
- Python or Ruby: Their syntax is intuitive (don't mention significant whitespace though ;), they have lots of libraries to quickly deal with graphics, games or the web, they're well documented without idioms that would be encountered early on and could confuse a kid.
- BASIC. I started out with it on an Amstrad CPC when I was 6 or 7. Interpreted, interactive procedural languages just feel natural to kids that age. I also learned that GOTO isn't necessarily bad (really, it isn't), and I also understood why functions are better than GOTO at a glance (spaghetti code didn't look neat or cool).
- If he/she's playing a game with a scripting language involved (like WoW with Lua scripts), try going that way. Most such languages are pretty simple, user friendly, plus results are directly visible. Exciting!
- Lego Mindstorms. One word: awesome. No, two: perfect.
- C is a little advanced, but if (s)he's interested in the inner working of a PC or a high-level data structure, it's probably one of the best ways to get down to it. Not recommended for absolute starters.
Basically, avoid high levels of abstraction and abstract concepts. A kid under 12 will probably have a hard time contemplating functional languages (although learning recursion at that age is a must). Also, if you're considering shell languages, I'd recommend Windows Powershell over bash/tcsh/etc. at least for a starter.
I think it depends on the age.
If he/she is 9-10-11 I think a fun combination could be a Lego Mindstorm robot that is controlled in C. You don't have to learn them pointers from the start, just let him mess around with the basic stuff such as data types and functions.
I think you should focus on results; getting a robot to do stuff could spike his/her interest because its 'cool'! A command line window might look dull.
SmallBasic by Microsoft. It is intended to provide a foundational understanding of programming. Comes with a nice kid friendly IDE
http://smallbasic.com/ http://msdn.microsoft.com/en-us/beginner/ff384126.aspx
I really don't think it matters what langauge, as long as they can compile and run code.
Most of us probably started with BASIC interpreters, so easy and readable code is obviously not a prerequisite. What BASIC interpreters did tend to do well was allow you to write a few lines, then run it and have it do what you said.
To answer the question then - I think any non-compiled language would be fine. I think things like Python is probably the best, as you're not required to program in an OO style, or in a functional style - just write lines, and they'll work.
Once the kids are interested and know a bit about how programming, sure, then teach them proper style. The important part is getting them to realise how to formulate thoughts in a structured manner - once you've done that, forming them in a different structure doesn't seem too hard.
The most important thing is to help the kids stay motivated. This happens if they have little successes. Now is the question: What is a succes to a 10 years old? Is it number printed out in command line or is it something colorful, maybe in a web browser? Personally I wouldn't recommend things like C, Assembler - the need month to leave the command line. My recommendation would be HTM/CSS - for a 10 years old this like programming - and then moving Javascript (obvious for the browser) or Python (Pygame and other fun stuff).
Remember, the most important ingredient to learning something is fun. If you got you kid started and it like what it is doing, it will choose the right programming language on it's own.
It really depends on the kid's interest level. If the kid is highly interested in learning how to program, most languages should be fine as long as you are there to help guide them.
If the kid doesn't really care, you might be able to spark interest with some sort of novelty, but they would probably get more out of it if you waited until they were older.
I was about 8 when I asked my dad to teach me how to program. Since I was interested and motivated, all he had to do was show me how to get started, and give me his old college textbooks. If I had lacked motivation, I imagine some more prodding on his part would have been effective, but if I had lacked interest, I don't think I would have learned much at all.
I asked a similar question a while ago, for a 13 year old: http://news.ycombinator.com/item?id=428095
Got a lot of great answers.
"Guido van Robot, or GvR for short, is a programming language and free software application designed to introduce beginners to the fundamentals of programming. GvR runs on Windows, Macintosh, and GNU/Linux, in a variety of languages. It's great in both the classroom and the home as a way of introducing people to the basic concepts of programming."
Then on to python.
Teach them HTML and CSS. Once they've mastered that move on to CFML (using either open source distro) which are just by now just more powerful tags. Once they've mastered that move on to JQuery and pretty soon they will be quickly building useful stuff that keeps them motivated.
Alice[1] may interest them. It teaches the very basics of programming without having to put them through the boring initial "Hello world!" experience right off the bat.
Google App Engine is not a language, but it is an environment where you can make a "hello world" web-page from scratch without much code... and it hosted and ready to show his/her grandparents out of the box.
@chipsy Agreed completely as far as HTML/CSS. That's what I started with when I was 9. It's a great, easy, and extremely useful foundation to build on later when they want to write more involved scripts.
undefined
Thank you all. Please keep 'em coming.
Lego NXT
Logo?
I'd recommend Microsoft Small Basic http://msdn.microsoft.com/en-ca/beginner/ff384126.aspx
It has a GUI which children will expect, runs out of the box on Windows which most kids will have, and allows them to easily interact with the GUI.
The other really nice thing is that as they progress they can use the full .NET runtime library so there is a lot of room to grow with out having to switch languages.
The only real downside is having a kid grow up like this: http://www.dailymotion.com/video/xdwn4e_java-4ever-microsoft... [.NET vs. Java trailer] youtube took it down :(