views:

1737

answers:

30

My 7 year old would like to learn how to program (his idea not mine, and he does things in the outside world so I am not too worried from that point of view. He already went so far as to take a game programming book out of my office to read at bed time.). The other day we sat down and wrote a very simple number guessing game (you pick 8 and it is correct, anything else it is wrong).

It went OK but there were a number of questions he had based on the syntax of the language (I happened to pick Java as I had the IDE opened at the time...). I teach post-secondary introductory programming courses so this was a bit of an eye opener to me (most students out of high school are reluctant to ask questions) as I really had to figure out how to explain syntax to a 7 year old.

Clearly any C type language is going to have the same issues, as will most “languages”. I looked at squeak but decided not to use it yet. I looked at the Alice environment but didn't like it for this either.

From a physical point of view he is comfortable with a keyboard/mouse and can put together Lego sets with relative ease (so following directions with a fun outcome works for him). I have access to Lego NXT but he is still a bit young for that (it takes too long to see the results of the work, even with the supplied graphical environment).

Ideally I'd like the experience to help him build up confidence in math and logic (if a 7 year old has logic :-).

I remember using turtle graphics/logo as a child. I am leaning towards this but wondering if there are any other ideas or if anyone can recommend a good logo environment?

Edit 1:

Logo works out well. I'll need to teach him the concept of angles (90 degrees, 180 degrees). Unfortunalty they don't really do division at school yet so angles might be fun...

First off draw a square:

FORWARD 50
RIGHT 90
FORWARD 50
RIGHT 90
FORWARD 50
RIGHT 90
FORWARD 50
RIGHT 90

At some point later I'll go into loops:

REPEAT 4 
[
    FORWARD 50
    RIGHT 90
]

And then variables:

make "length 50

REPEAT 4 
[
    FORWARD :length
    RIGHT 90
]

This works out very well. Virtually no syntax, easy for a 7 year old to remember the vocabulary, and immediate feedback.

Edit 2:

Well it was a success, in that he was able to write a simple program (no loops yet) while I was out of the room. It actually works out very well - we went out and got to graph paper and a protractor, we fugured out 90 degree angles, and he made a bunch of squares, turned a square into a rectangle, and got to see where he went wrong and how to debug it. I'd recommend this approach for anyone with a 7 year old who is interested in programming. I think I'd recommend it to my post-secondary students too (!)

+5  A: 

I think that Python might fit your needs. It is well known for being easier to learn than many other languages and the interactive interpreter allows programmers to immediately see what happens when a piece of code is executed. The IDLE gui that comes with it is easy to use. It also has a turtle module through TKinter.

http://www.python.org/doc/2.5.2/lib/module-turtle.html

2-bits
For a 7-year old, though?
Bob Somers
Not to toot my own horn, but I was teaching myself BASIC and writing meaningful apps at age 6-7. Given enough time and motivation, it's totally possible. I'm sure I would have done better given Python. I do recall pointers tripping me up a bit when I tried switching to Pascal at age 8, though.
Nicholas Riley
+21  A: 

There is actually a browser-based Logo interpreter in Javascript.

http://logo.twentygototen.org/

cdonner
Oh, the nostalgia.
lc
thanks! That should be perfect.
TofuBeer
Wow, logo! I remember learning that around 4th grade and writing a little Pac-man animation.
gnovice
I couldn't get your link to work - but I got this one to work for Logohttp://www.softronix.com/logo.html
Rob Bergin
Thanks to YOSPOS.
Eric
+4  A: 

Developmentally, a seven year-old is unlikely to grasp the basics of syntax even in their spoken language.

Whatever language or environment you use, I would recommend focusing on the idea of programming as play rather than the ability to write actual programs. Towards this end, something you can run from a command line and see immediate results, like Python or, for a more graphical experience, Silverlight, would probably be best.

Jekke
yeah that is what I did (not focusing on the syntax)... I asked him to explain what he wanted to happen and then I wrote the code... but even that wasn't "fun" (for either of us.
TofuBeer
Hey! Never underestimate the power of children. My dad got me a Timex Sinclair 1000 when I was 7, I learned BASIC pretty easily (but don't tarnish a clean slate with BASIC!), and my dad helped me write a program to generate prime #s.
Jason S
+5  A: 

Microsoft has a couple of interesting efforts that seems a nice fit:

  • popfly: http://msdn.microsoft.com/en-us/devlabs/cc950523.aspx --- "Popfly includes a simple way to create and share games with your friends. Choose from a variety of built-in templates or start from scratch to create a side scrolling game, a 2D shoot-em-up, or a host of others. And best of all, you can get started without writing a line of code" ... I think it can really help being motivated :)

eglasius
+1  A: 

Etoys is perhaps the thing you're looking for. It's a partly graphical flavour of smalltalk made just for children. This is used by the olpc project.

TokenMacGuy
+2  A: 

Why not go back to the days of QBasic? That's the first language I learned (actually it was GW-BASIC, but that's beside the point).

The syntax is much easier to get one's head around (albeit fickle and sometimes downright frustrating). It doesn't teach anything OO, but that's probably above his head anyway, as it would have been mine.

This site may also be of interest.

lc
Yes! QBasic is the best! That's how I learned too.
Isaac Waller
+6  A: 

Tell him about parsers. You just need to add context and reasoning to why things exist. The curly braces are so that the machine that reads the code knows where things start and stop.

I find that most people including children pick up things easily as long as you explain the purpose of them. This is why school was a terrible failure for me, no-one ever explaining the point of learning half the stuff.

Quibblesome
+1 because of the explain purpose comment --- I would still look at a simpler environment though
eglasius
I have no issue with that, and indeed I had the same experience, but not yet - first I want to be sure he is interested (I don't want to turn him off of programming)
TofuBeer
+1 for the purpose thingy also
Jason S
Hmm. I agree with the concept, but I suspect that this is going to remain too abstract for a 7 year old.
Beska
Another +1 for the purpose. I wish many of my teachers did that...
lc
We as developers are used to tell explicity what we want (to the smallest detail) to the computer, I think the kid must be taught that the computers are really dumb and need help, that's why we have give such explicits instructions in such a dumb down manner, otherwise he might feel dumb.
levhita
+1 Explain purpose. Amen to that.
Dana
A: 

I would have looked for one of the many arcade game engines and let him play with that. Choose one where he will need to use loops and conditions, and maybe some procedures.

Itay Moav
amdfan
Yes yes, loops and conditions, they do understand this, you know.
Itay Moav
somebody needs some hater-aid
Booji Boy
+22  A: 

I strongly disagree with the people who say seven year olds would have a hard time learning new syntax. This is completely backwards. Try teaching pig latin to a seven year old and to a thirty something non-native English speaker. Or try traveling in a foreign country with your kids. See who can chat fluently with the natives after a month (hint: it probably won't be you).

Kids pick up on arbitrary linguistic conventions much faster than us gray hairs do.

MarkusQ
I agree, but there needs to be motivation for the learning as well, and it would seem that learning about syntax isn't all the satisfying to a 7 year old who is just starting out :-)
TofuBeer
I disagree with this. They have an innate knowledge of syntax that has been driven into them through an enormous amount of repetition, but they do not understand the rules of their syntax. Therefore, saying that they can easily learn another one is a misleading.
Beska
First of all "innate knowledge" is the exact opposite of "driven into them through an enormous amount of repetition"; second, all the hard data point to children being able to learn new grammatical systems far more rapidly that adults. It's not repetition it's developmental predisposition.
MarkusQ
I've seen a study that says that adults are even better at learning new languages, it's just that they are far better at finding reasons not to. I don't remember where I saw it, unfortunately.
David Thornley
+4  A: 

Try Small Basic, which has a mini-BASIC language and simplified for the younger crowd.

JTA
see my answer ;)
eglasius
"It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: As potential programmers they are mentally mutilated beyond hope of regeneration." -- Edsger Dijkstra
Svante
Svante... seriously... he/she's 7
JTA
+1  A: 

I was involved with a primary-grade computer course using Stagecast. This is a graphical programming language designed for children. I found it an ideal introductory language because it is graphical and interactive. It does not require reading or mathematics, it runs on Windows and Mac OS, and is ideal for simple games so children are motivated to learn.

Dour High Arch
+5  A: 

Scratch is another one. Developed at MIT specifically for the purpose of teaching programming to children.

Jörg W Mittag
I second the mention of Scratch. I used it to introduce basic programming concepts to my own 7 year old son and it went over very well.
Eric King
+12  A: 

I learned how to program when I was 10 in exactly the way you taught your son. My dad used the GW-Basic interpreter that came with our AT&T PC6300, and we wrote a game where the computer asked you a question, and you had to answer A/B/C. The big advantage to syntax in GW-Basic was that you didn't have multi-line statements. You might want to try something similar. Java, with it's curly braces, might be a little tough.

Example code:

10 PRINT "What color is Big Bird?"
20 PRINT "A. Blue"
30 PRINT "B. Green"
40 PRINT "C. Yellow"
50 INPUT$ ANSWER$
60 IF ANSWER$ = "C" THEN PRINT "Good Job!" ELSE PRINT "Oops, wrong answer!"

I spent hours upon hours using various permutations of that syntax and writing my own "games". And it made me want to learn more... might help.

sheepsimulator
This brings back memories of how I learnt...
AlexJReid
+2  A: 

I'd say use visual basic, or something similar where you don't have to worry about syntax, curly braces, etc as much. I was programming at 7, but it was in LOGO and C64 Basic. I HATED LOGO ... it was so frustrating to me that one of the "big" things you could do was move around a stupid turtle. However, C64 Basic (to me) was great ... once I had that down (a couple years) I was psyched to learn C and even C64 assembler.

Jess
+2  A: 

Two thoughts come to mind:

  • My 3 year old son loves playing World of Goo with me. He can't solve problems yet, but I can see he is soaking up loads of information.
  • Have a go with Alice. My son is too young to try this, but once he is older we'll give it a go if he is keen. FWIW I learnt about this program after watching The Last Lecuture by Randy Pausch (R.I.P)
Si
World of Goo is great! As for Alice it just seems to be not immediate enough. Ideally I want him to be able to do some of it on his own without having to ask me every minute. I did this with Lego where it started with me building, then me getting him the pieces and now he does it on his own.
TofuBeer
+1  A: 

While it appears that it is being redesigned, you can still get the old version of Hackety Hack, which is a ruby programming kit designed by _why for teenagers and beginning programmers.

Eddie Jesinsky
+1  A: 

I am a bit torn about Alice.

On the one hand, it is nice to have a framework where you can program with direct visual gratification. This is really a good idea.

On the other hand, I think that it is a very bad idea to have beginners program exclusively by drag and drop. I fear that this might even lead to a sort of illiteracy, where they are unable to produce properly written code when the drag and drop interface is taken away.

Svante
The new Alice, version 3.0 coming out later this year, is Java behind the scenes. At any time, you can show either Java-like code (still drag-and-drop) or switch to a 100% Java view in NetBeans. Very cool, but probably not for 7 year-olds.
Barry Brown
A: 

There a book called Learning to program from pragmatic that is geared towards people who have never programmed before and might not be extremely technical.

It uses Ruby which can be quite easy for new people to pick up.

nkassis
A: 

Squeak Smalltalk system is an implementation of Smalltalk that I have heard much good about when it comes to educating children in programming. The Etoys project supposedly contains lots of resources for keeping the learning experience fun and motivating.

PHeiberg
+2  A: 

Flee from Java! Try something designed for teaching, like scratch, LOGO, or PLT Scheme.

Norman Ramsey
I didn't expect Java to work out, but had to start somewhere to see where to go (and Netbeans was open at the time...). He is keen on Logo and it looks like that is where I will start. I'll also be looking at what people suggested to pick the next step.
TofuBeer
Fair enough. It's always good to reward constructive activity *immediately* (works with graduate students, too).
Norman Ramsey
A: 

I became interested in programming when I was introduced to Turing language in high school. Turing was used as a teaching language in many schools at the time, and it worked very well for me to introduce programming concepts. Here is a description of Turing from WikiPedia

Turing is a Pascal-like programming language developed in 1982 by Ric Holt and James Cordy, then of University of Toronto, Canada. Turing is a descendant of Euclid, Pascal and SP/k that features a clean syntax and precise machine-independent semantics.

Named after British computer scientist Alan Turing, Turing is used primarily as a teaching language at the high school and university level. Two other versions exist, Object-Oriented Turing and Turing Plus, a systems programming variant. In September 2001, "Object Oriented Turing" was renamed "Turing" and the original Turing was renamed "Classic Turing". Turing is available from Holt Software Associates in Toronto.

Versions for Microsoft Windows, Linux and Apple Macintosh are available. Turing is still widely used in high schools in Ontario as an introduction to programming.

In November 2007, Turing, which was previously a commercialized programming language, became freeware. As of November 28, 2007, it was available for download from the Holt Software website free of charge for personal, commercial, and educational use.[1]

Roberto Sebestyen
+1  A: 

Personally, I think the basics of arithmetic operations and Boolean logic are more important to teach to a child first. After they have grasped these concepts then I think moving on to the basic constructs are appropriate. I just don't see how a child could understand conditionals and looping without Boolean logic, but then again, there are some pretty bright kids out there :)

Assuming the previous statement is met, I would have to cast my vote for python.

javamonkey79
A: 

You could also use Commodore 64 emulator. It start's right from BASIC.

raspi
+1  A: 

Have him check out http://scratch.mit.edu. My seven year old is learning this as we type...

jm04469
Scratch is perfect for kids up through middle school. +1
Barry Brown
A: 

Might as well throw out Lego™ Mindstorms™ as a possibility. It uses a graphical programming language based on LabView.

GoatRider
A: 

I read this post earlier today, and then by chance accidentally went to YUP.com and discovered

Teaching Kids to Hack(Program) with Hackety Hack

Figured I'd post it as an additional resource for anyone looking at this question.

instanceofTom
A: 

I recently responded to a similar SO question with a pointer to kidbasic, which is open source and cross platform software.

none
A: 

Scheme is nice and syntactically similar to Logo, in the respects of simplicity. Also Scheme offers a very intuitive way of understanding recursion and picking up these type of fundamental concepts in computer science that early on is nothing but good with more good.

UCB Scheme also offers a lot of built in functionality for manipulating sentences, which may make more sense to a 7 year old than constructing polygons and solving number puzzles (not to say that the sky's the limit!).

mduvall
A: 

I was typing programs from the book "BASIC Fun" when I was in 2nd grade.

I distinctly remember that the concepts of infinite loops and INPUT A$ was like discovering gravity. Heady stuff.

Self taught, my progress was glacially slow, although I did reach a point in a program where I wished that GOSUB took variable arguments, which in retrospect meant I understood function pointers.

My early goals included writing LONG programs. A lengthy program not a bad goal for a 7 year old because a program with a well defined spec makes the risk of failure too high. Anyone can write a long program and feel good about it and learn a lot along the way.

There was a whole genre of books for programming in BASIC for kinds from the 80s. That stuff is a great source of programming ideas. However I wouldn't recommend using BASIC even for a 7 year old-- lua has the simple feel of BASIC but it isn't broken crap.

MatthewMartin
A: 
GeneQ