Question

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 (!)

Was it helpful?

Solution

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

http://logo.twentygototen.org/

OTHER TIPS

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.

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.

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.

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

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.

https://docs.python.org/library/turtle.html

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.

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

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

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

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.

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.

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)

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

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.

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.

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.

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.

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.

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.

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.

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.

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

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

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

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.

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

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!).

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.

Look no further, there's actually an entire learning platform/ OS designed for this very purpose: Sugar.

The OLPC (One Laptop Per Child) operating system called Sugar is now available to the general public and you can run it as a VM within all major operating systems such as Mac, Windows and Linux.

Download a copy at Sugar Labs.

One interesting activity included is called TurtleArt, a souped up 21st century version of Logo. Also has a kid friendly version of a Python IDE called Pippy. It actually teaches kids Python!

See TurtleArt and Pippy and the other activities found in Sugar.

Alan Kay was behind some of the novel concepts in Sugar OS which is actually a modern incarnation of his visionary DynaBook. Even as an adult (who's an engineer), I find it fun to play with.

And if you love Sugar as a VM, you can even buy the hardware and at the same time help a poor kid somewhere else in the world.

Engadget explains : OLPC XO Buy-One, Give-One program underway

OLPC OX

As a bonus to us adults, Sugar is derived from Fedora. So it's a real and complete Linux based OS. Should be fun to hack. ;-)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top