39

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

mumair
  • 2,768
  • 30
  • 39
TofuBeer
  • 60,850
  • 18
  • 118
  • 163
  • There is a duplicate that addresses 9 year olds: http://stackoverflow.com/questions/37133/programming-for-a-9-year-old I don't think there should be that much of a difference in your answers. – TheTXI Feb 27 '09 at 19:12
  • 1
    I disagree with the "duplicate" tag. Developmentally, a nine year-old is hugely different from a seven year-old. – Yes - that Jake. Feb 27 '09 at 19:16
  • I read a number of threads before I posted, didn't see that one. I also disagree with it being a dup - for instance I specifically stated I wasn't interested in Alice and it is mentioned there. A 9 year old and a 7 year ol have way different levels of understanding as well. – TofuBeer Feb 27 '09 at 19:19
  • 2
    So are we going to have one question for each age? Closing as a dupe. – Robert S. Feb 27 '09 at 19:26
  • 7 != 9. And if you have any doubts ask a 7 year old child in your life to write a poem. Than ask a 9 year old. Finally, take the results and read them to another adult and see if they can identify which was written by the older child. – Jon 'links in bio' Ericson Feb 27 '09 at 19:34
  • It would have been much better at some point to have a thread discussing programming languages and learning techniques for children and then the answers could diverge or give multiple answers based on age ranges. Having a question for every age group is going to lead into tons of overlap. – TheTXI Feb 27 '09 at 19:35
  • I don't think there would be anything wrong with having a number of questions based on what's an appropriate programming environment at, say, 5, 7, 9, 11, 13, 16. These are different questions with decidedly different answers. – Yes - that Jake. Feb 27 '09 at 19:38
  • I didn't agree with this question being closed, but I don't agree with that statement Jekke. When you go 11 and above, it wouldn't be so much about the age but what previous experience the person has ... some teenagers have written software that many don't know how to regardless the age – eglasius Feb 27 '09 at 19:45
  • I agree in principle, Freddy. It would have been more accurate to say that I would support questions about what is appropriate for *introducing* a sixteen year-old to programming versus a thirteen year-old. – Yes - that Jake. Feb 27 '09 at 19:47
  • lol, it's only technically not a duplicate. I'm sure there are many physiological differences between 7 and 9 year olds, but they still fall under the classic term of child. Seems like you are just asking for questions for number age, and that would divide up the info too much. – Mark Rogers Feb 27 '09 at 20:50
  • @Jon Ericson, this site isn't about poetry. – Robert S. Feb 27 '09 at 21:56
  • @Out Into Space, as a programmer you should understand abstractions (:-P), while it isn't about poetry it is about the intellectual capabilities of a seven year old compared to a 9 year old - and those differences are pretty large. – TofuBeer Feb 27 '09 at 22:48
  • @Out Into Space: You are clearly not a Perl programmer. ;-) If it make you feel better, repeat the experiment with, say instructions for making a peanut butter and jelly sandwich. For added fun, have the children "debug" their code. Children become better communicators as they age. – Jon 'links in bio' Ericson Feb 27 '09 at 23:25
  • @TofuBeer, last time I checked, StackOverflow was not about the intellectual differences between children in different age groups. – Robert S. Feb 27 '09 at 23:39
  • @Out Into Space, yes, but the intellectual differences matter when it comes to programming. Pretty sure it is a programming site and it was a programming question. I looked at the other answers before I posted and didn't find any that I thought were suitable. The thread on 9 years olds wasn't. – TofuBeer Feb 27 '09 at 23:46
  • @Out Into Space: That's why we are in comments (meta-conversation) not in the Q/A itself. The only reason this topic was broached was because the question was closed as a duplicate of a similar question. Knowing a little bit about child development is required to make that call. – Jon 'links in bio' Ericson Feb 28 '09 at 00:01
  • Yes, you have reinforced my belief that playing with legos for my entire childhood led me to programming! I never followed the directions though, I always had to build my own stuff. – dotjoe Jun 12 '09 at 21:01

31 Answers31

23

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

http://logo.twentygototen.org/

cdonner
  • 37,019
  • 22
  • 105
  • 153
23

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.

GEOCHET
  • 21,119
  • 15
  • 74
  • 98
MarkusQ
  • 21,814
  • 3
  • 56
  • 68
  • 2
    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 Feb 27 '09 at 19:59
  • 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 Feb 27 '09 at 20:34
  • 2
    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 Feb 27 '09 at 22:56
  • 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 Jun 12 '09 at 20:54
12

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.

J. Polfer
  • 12,251
  • 10
  • 54
  • 83
9

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
  • 25,225
  • 10
  • 61
  • 100
  • 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 Feb 27 '09 at 19:26
  • Hmm. I agree with the concept, but I suspect that this is going to remain too abstract for a 7 year old. – Beska Feb 27 '09 at 20:32
  • Another +1 for the purpose. I wish many of my teachers did that... – lc. Feb 27 '09 at 20:44
  • 1
    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 Feb 27 '09 at 21:18
6

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

twasbrillig
  • 17,084
  • 9
  • 43
  • 67
2-bits
  • 453
  • 6
  • 12
  • 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 Apr 10 '09 at 03:16
  • 1
    Now he is 10, and starting on Python. Wrote an English -> Pig Latin and a Pig Latin -> English translator the other day. – TofuBeer Feb 18 '12 at 17:03
6

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

Jörg W Mittag
  • 363,080
  • 75
  • 446
  • 653
  • 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 Feb 27 '09 at 23:13
5

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.

Yes - that Jake.
  • 16,725
  • 14
  • 70
  • 96
  • 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 Feb 27 '09 at 19:17
  • 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 Feb 27 '09 at 20:05
5

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
  • 35,831
  • 5
  • 65
  • 110
4

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

Inisheer
  • 20,376
  • 9
  • 50
  • 82
  • "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 Feb 27 '09 at 22:19
  • Svante... seriously... he/she's 7 – Inisheer Feb 27 '09 at 23:20
3

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

Norman Ramsey
  • 198,648
  • 61
  • 360
  • 533
  • 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 Feb 28 '09 at 04:10
  • Fair enough. It's always good to reward constructive activity *immediately* (works with graduate students, too). – Norman Ramsey Feb 28 '09 at 04:42
2

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.
  • 113,939
  • 20
  • 158
  • 187
2

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.

Beep beep
  • 18,873
  • 12
  • 63
  • 78
2

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)
si618
  • 16,580
  • 12
  • 67
  • 84
  • 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 Feb 27 '09 at 21:19
2

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

McGovernTheory
  • 6,556
  • 4
  • 41
  • 75
1

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.

SingleNegationElimination
  • 151,563
  • 33
  • 264
  • 304
1

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
  • 21,513
  • 29
  • 75
  • 90
1

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 J
  • 11
  • 4
1

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
  • 50,694
  • 11
  • 78
  • 122
  • 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 Jun 12 '09 at 21:01
1

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
  • 17,443
  • 36
  • 114
  • 172
0

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
  • 32,326
  • 33
  • 105
  • 164
0

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

Community
  • 1
  • 1
GeneQ
  • 7,485
  • 6
  • 37
  • 53
0

I've had a good deal of fun with my 6 year old and Greenfoot (http://www.greenfoot.org/). It is object-centric, and visual/graphical, which clicked well with my kid.

0

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 -Malimovka
  • 52,579
  • 61
  • 190
  • 278
0

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
  • 5,285
  • 2
  • 21
  • 22
0

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
  • 29,411
  • 6
  • 59
  • 81
0

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

7wp
  • 12,505
  • 20
  • 77
  • 103
0

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

raspi
  • 5,962
  • 3
  • 34
  • 51
0

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

GoatRider
  • 1,213
  • 6
  • 12
0

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.

Tom Neyland
  • 6,860
  • 2
  • 36
  • 52
0

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

Community
  • 1
  • 1
none
  • 5,701
  • 28
  • 32
0

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
  • 1,018
  • 1
  • 8
  • 15