
Ask HN: What programming languages to teach kids under 12 years old? - hariis
What programming languages would be beneficial for kids under 12 years old?<p>Links to resources would be greatly appreciated.
======
chipsy
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)

~~~
ImFatYoureFat
I totally agree that html/css with js and maybe even some basic php if they
are up for it is the way to go.

Sure html and css aren't languages, but couple them with javascript and a
complete novice can make quite a few dynamic pages (read programs) in an
afternoon.

I think one of the most important elements for introducing young children, or
really anyone, to programming is providing the ability to build a complete
interactive program almost immediately. This can definitely be accomplished
with a few html tags and a few lines of js.

Alternatively, if you have access to a licenses for it I would recommend
initially starting them out in Visual Basic Studio. It strikes me as a good
balance between immediate buildableness and a easy environment to learn the
basics of loops, strings, if/then, for/do, etc. Maybe a week or two in vbs and
then switch them over to js.

While I have no qualms with languages like ruby or python, the call for them
to be used as introductory languages seem misleading. While you can learn to
build a stand alone program in them in a week or less, I get the feeling that
a static box program is not going to be that exciting for most 10-12 year olds
today (obviously this same problem exists for vbs)

My feeling is that to most children computers are two things, the internet and
video games. Building your own video games immediately (outside of flash which
isn't a terrible suggestion) is somewhat out of reach for most beginners. But
building web pages, and pretty interesting ones at that, is very accessible
for anyone once they get the syntax down. In truth you have to get relatively
far into ruby or python before you can understand how to display a page you've
build or get to very much interactivity.

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

~~~
fleitz
I have to agree, probably the only kid who cut grass to buy a C compiler
(Turbo C FTW!). I think I was 14 when I started writing C.

I was pissed later that summer when I installed FreeBSD only to find out these
things were free.

Most of learning to program is motivation and patience in my estimation.

~~~
jlangenauer
Nah, I remember saving to buy Microsoft QuickC for Windows when I was 12 or
13. Good times, those.

------
SkyMarshal
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:

<http://racket-lang.org>

or install the package 'plt-scheme' from whatever Linux distro you're using.

~~~
snikeris
Seconded. Writing the card game 'war' might be a fun challenge:
<http://docs.racket-lang.org/cards/index.html>

------
jonp
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?

~~~
mullr
I totally agree. This is what processing is for. Even though I program as a
job, a few hours with processing put a smile on my face; this is really what
it used to be like. It's fun.

------
judofyr
Hackety Hack is trying to accomplish this:
<http://en.wikipedia.org/wiki/Hackety_Hack>

~~~
steveklabnik
Thanks for mentioning it. (I'm the maintainer)

I have to mention that there are still some bugs, since we're pre 1.0. These
should be fixed in the coming weeks, though, 1.0 should be out for Whyday!

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

[1] <http://scratch.mit.edu/>

------
jolan
[from the other thread] There's LOGO if you want to go old school with turtle
graphics:

<http://www.cs.berkeley.edu/~bh/logo.html>

~~~
fleg
<http://edu.kde.org/kturtle/> \- KDE4's version of LOGO. One of the advantages
is that you can select language of commands - English, German, Polish and so
on, so if your kid doesn't speak english it doean't mean it can't program
easily.

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

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

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

------
kouPhax
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>

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

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

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

------
danie
Have a look at [http://news.squeak.org/2008/10/28/squeak-learn-
programming-w...](http://news.squeak.org/2008/10/28/squeak-learn-programming-
with-robots-now-free/)

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

~~~
nimrody
Can you report on what works and what does not?

Specifically, I'm interested to know whether Javascript in the browser is good
enough, or too difficult to use in practice.

~~~
atestu
Actually, my brother gave up before even trying (at this age "passions" are
sometimes a very passing phenomenon).

I'd recommend pygame over web development. Making a video game is much more
fulfilling at that age in my opinion. Ask any 12 year old "do you want to make
a video game or a website?"

For an older kid (~16), web development with APIs such as Facebook can be
interesting too, because (s)he'll want to brag about it to his/her friends.

~~~
nimrody
Thanks!

I really like the Facebook app/games idea, since current video games set the
bar way too high for any individual working alone. Making "Pong"-type of games
will probably not impress anyone these days :)

------
Deprecated
"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."

<http://gvr.sourceforge.net/>

Then on to python.

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

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

[1] <http://www.alice.org/>

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

------
bcherny
@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.

------
rtayek
<http://teachingkidsprogramming.com/>

~~~
pbhjpbhj
The useful content appears to be links to <http://wiki.smallbasic.com/> and
<http://extendsmallbasic.codeplex.com/> ; though I didn't watch the video.

They use a sucky framing policy where they frame the smallbasic wiki whilst
displaying their own ads. This makes me instantly distrust the domain holder -
however the apparent writers are working with kids doing programming (and
appear to have married since they started the site) as
[http://blogs.msdn.com/b/socaldevgal/archive/2010/06/17/teach...](http://blogs.msdn.com/b/socaldevgal/archive/2010/06/17/teaching-
kids-programming-after-school-class-lessons-learned.aspx) attests.

------
hariis
Thank you all. Please keep 'em coming.

------
stevoo
Lego NXT

------
the8thbit
Logo?

------
fleitz
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...](http://www.dailymotion.com/video/xdwn4e_java-4ever-microsoft-
net-vs-java_shortfilms) [.NET vs. Java trailer] youtube took it down :(

~~~
steverb
If you're not afraid of Microsoft I recommend Kodu
<http://research.microsoft.com/en-us/projects/kodu/> My kids literally beg me
to be allowed to program with Kodu. It's very visual and very X-Box friendly.

