Programming options for kids

201109141502

Cult of Mac has an item about a six-year-old girl named Lim Xin Mei (above) who is learning computer programming. The article says she was using Applesoft BASIC on an old Apple II GS. Later she started using a Power Mac 7200 running an Apple II GS emulator.

My 8-year-old daughter likes to write games using Scratch, but I think I should introduce her to a text-based programming language. I thought BASIC would be good language to start with, but then I realized I just wanted to do that because that's how I started programming decades ago. Times have changed. I think Python might be a better choice.

I'm curious to know about programming languages, books, websites, or other resources to help teach kids how to write computer programs. Please post them in the discussion comments.

151

  1. I chose Processing because I wanted them to be able to quickly see things on the screen.  “Making Software” talked about “why is programming hard?” and one of the interesting things I got from that part of the book was that girls (and students in general) were more interested in programming in general if you get away from pardon the phrase “Stupid Math Tricks”.  Get them doing stuff with items they can actually care about.

    Maybe they care about math and if they do, that’s awesome.  But if there’s tenuous interest or if there’s perceived bias about, “oh, numbers and algorithms are for dorks with no life” they may never make it past a loop statement.

    “Yes, we’re going to increment X here because that makes the missle go closer to the robot we want to blow up.”  (win!)

  2. Javascript is about to eat the world due to HTML5 and Windows8. Unlike a lot of languages, you can quickly learn to do really cool internet stuff because it runs in the browser. If you’ve never tried this before, open up a recent version of Firefox and type shift-F4: you will launch Scratchpad which is an insanely wonderful javascript sandbox, free as in beer.

  3. Zed Shaw’s Learn Python the Hard Way http://learnpythonthehardway.org/ is an adult book that smart teenagers seem to like. And there’s a free version! A lot of kids enjoy the fact that they’re learning a “real” language – just like mum and dad use.

    And for once, Zed holds back on the cussing…

  4. I showed my daughter about programming when she was maybe 11 or 12.  We used KDS, and she built herself a nice spaceship floating around, and was thinking about movies and such. I suspect she was thinking about writing a dialog to accompany the animated characters she was creating on screen, aka animated movie-fashion.  In the end, she went towards other interests, and is now enrolled in post-secondary biology, but I can’t help but think that her time spent with programming has given her at the least a basic understanding she has not received elsewhere, and beyond that a real picture of how computers play a major role in so much of what we do regardless of the field we end up in.

  5. Starting when I was 7, I learned to program on an Atari 800 Basic cartridge. Just picked up the book on my own. I think I was interested when my older brother showed me a program he wrote on our TRS80 a few years prior. I switched to QuickBasic later when I was old enough to use the family PC, then VB 6 in highschool, and mostly C# today. ZZT is a game making language that uses ASCII graphics, I had a ton of fun with it in my middle school years. The syntax is similar to Basic, but sort of unique. I recommend trying to start her with a C-syntax type language. The hardest thing for me about transitioning out of Basic was getting used to the syntax and the requirement to declare variables.As other people mentioned, JavaScript is a nice language to learn on. I really recommend learning jQuery along side if you want to do fun DOM manipulation. I use Firefox with FireBug as my JavaScript debugger.Regarding teaching techniques. When I was young, once I had learned the fundamentals, my brother would give me assignments of simple programs to write. For example, I had to write a game where the computer would pick a number between 1 and 100, and the player would have to guess it in as few guesses as possible. After each guess, the computer would give a clue of “you’re too high” or “you’re too low”.Side note on the benefits of learning to program: I found my experience with programming really helped me when I learned algebra. From day 1, I was completely comfortable with the concept of a number being represented by a variable. It also made me a very good problem solver, or maybe I’m a good programmer because I’m naturally a good problem solver.

  6. When i was a kid in ye olde days of primary/middle school grades we had a computer class that taught basic programming and computer skills. The program was called Logo Writer i belive, one could do all sorts of nifty things with it like program basic games, animations (with random outcomes even), drawings, and text based programming as well like tests.

    The program is painfully old, and i wonder if there’s a modern alternative or variation of it. Anyone else here use the program as well? I’m very curious about that.

    1. Yes.  There are online versions of Logo that run as java applets (and you could probably dig out DOSbox as well), if you need a shot of nostalgia. ;)

  7. I loved programming in BASIC when I was a kid.  I swear that learning BASIC has helped me in my current job, wherein I write a ton of reports in Access and Excel using IF/THEN statements.

    1. Agreed. BASIC is my first language too (and probably the only option for Apple II programmers until we learned enough PEEK/POKE and assembly).

  8. Things were easier in the olden days, when every damn home computer came with BASIC of some sort or another, and there were plenty of books and magazines (like Creative Computing as Sam mentions) to provide support. There were differences in implementation between platforms, but there were enough commonalities to make BASIC a lingua franca of sorts.

    The very fact that BASIC was included, and was often the default way of interacting with the machine, invited kids to try programming. Today the concept is alien. Most kids use a computer without the slightest idea they can muck around and control it.

    (YEAH, YEAH I KNOW that a sort of BASIC is included with Windows, but it is buried way deep and no one would think about using it for teaching.)

    I think Python might be the way to go. There is at least one book on game programming in Python.

    It would be nice to have a special kid-friendly IDE for Python.

    1. Considering TI’s domination of the educational calculator market, TI-Basic is pretty easily accessible.  I developed quite a bit of muscle memory to input control commands through the quirky interface.

  9. Dear lord, the idea of starting out programming with Javascript and Jquery is making me weep openly in public. If Basic creates broken programmers, what insane monsters would that produce? Would the future ever forgive us that sin?

    I can see it now, in the blasted hulk of what was a great Earth city, a group of filthy, feral children sit around an elder telling the tale of when lambda functions were wrapped in lambda functions that were wrapped in lambda functions and how the whole world went mad, and the machines became self-aware and turned the atom bombs against themselves because their code was an unmaintainable mess and they felt suicide was the only chance for salvation.

    1. We could have mentioned LISP :)

       But you’re right, I would prefer that JavaScript had better typing and classes, and all the constructs that good programmers use.

  10. Another vote for Processing. As important as the language and good examples is someone to ask how to find or fix bugs, or at least point to the right place to find the solution.

  11. I agree with Processing if your intent is to get your kid interested in programming and experimentation with writing code and seeing what happens.  However, because it’s so graphically-oriented, it has a lot more complexities (associated with one-time vs. continual drawing) than would be found in languages that have more straightforward control flow.  In particular, you will want to install one of the third-party UI libraries, like controlp5, to do buttons and things.

    Python is fine if you want to learn how to program (rather than just “messing around”), because it is a bit more straightforward to understand exactly how the code will be handled.  It would be a good introduction if you were considering a future that involved programming of any kind, but not as quickly engaging as processing.

  12. It’s a real shame but probably the greatest programming learning tool for kids is mostly unknown, Colobot: http://www.ceebot.com/colobot/index-e.php

    It still requires someone to provide instruction and guidance but the way it provides a series of structured goals to follow really hooks kids in.

  13. Not a text-based environment, but something which can be done in the back seat of the car:
    Nintendo’s game “WarioWare: D.I.Y.” for the Nintendo DS not only has an editor where you can design your own short “microgames”, it also has guided activities such as completing half-built games. It’s an interesting visual programming environment in that, despite the set of tools seeming very restrictive, it’s possible to find ways to do surprisingly elaborate things with them. There’s a logic editor, a music editor, and a graphics editor, all done with the traditional Nintendo polish (and clearly owing a lot to the classic “Mario Paint”.) I’d say “WarioWare: D.I.Y.” is suitable for kids around ages 8-14 or so. It’s pretty lightweight compare to what you can do on a real computer, but it’s the only Nintendo DS cartridge I can think of which provides this sort of design experience.
    http://www.wariowarediy.com/

    1. Yes! Jane has “WarioWare: D.I.Y.” We both laughed until tears came out of our eyes when Wario was trying to draw a brick wall the hard way.

  14. I would use javascript. It gets kids doing something they can relate to (making web pages do things) right away, rather than printing “hello world” to a text console that they’ve never even opened before.

    I started programming in perl for this exact reason in the mid 90’s — because it was how you made interactive web pages, and the web is what made computers interesting to me.

  15. Mark, you sound like such a wonderful dad. Man, there are a lot of great parents commenting, lucky kids! :)

    1. 6502 assembly. My son always wanted to learn that, but I don’t wanted to teach him. This gives me at least an advantage over him forever!

  16. I would suggest Pascal over Basic if you want an older language that you think is appropriate.  But really, why would they have a problem with ruby? RUBY is my vote

    1. I would start with BASIC – then Pascal. BASIC for simple stuffs – variables, loop, branch, etc (eg I used Applesoft BASIC, thus graphics commands). Not that demanding.

      Then if the kids really needs to use GOTO – it is time to switch to Pascal.

  17. By all means, email the Scratch Team, and talk to them. They’re friendly. Maybe Scratch is moving in the direction you’d like, or you missed something. That being said, I have heard parents say that their kids “outgrew” Scratch.

    After much thought, I have decided that BASIC is not a very good programming language, even if you have a Windows PC, and even if you stick to text-based stuff. All of the old Creative Computing games, they aren’t about writing games. They’re about figuring out what the old, ugly, bad code does. There is no reason to give that to a kid. Give them good code to work with!

    Any modern kid-programming language should, in my opinion, make it easy to do modern fun things:
    a) animation of good-looking graphics
    b) internet-aware (be able to access Google APIs, for example, and allow players on separate machines)
    c) at least some rudimentary sound
    d) maybe fancy stuff like camera support and location awareness, multi-touch, and rudimentary support for UI elements.

    Here’s three possibilities:

    1) “eToys” is the more-sophisticated big sibling of “Scratch.” It is designed by Alan Kay (one of the smartest programming language designers ever, involved with SmallTalk, and recipient of the “Nobel Prize of computer science”), and Ted Kaehler, who designed HyperTalk (part of Hypercard.)
    2) PyGame is an add-on to Python that makes game programming much easier. Also on the plus side, there’s some good books. On the minus side, getting Python and PyGame set up will require patience and assistance. Also, many people say the bundled IDE, called IDLE, stinks. I use Xcode. It’s not exactly an ideal match. But it can work, especially if you set up keystroke macros that launch/quit the code being edited, etc.

    3) JavaScript is a swell language, for the most part. You can do clever things like “foreach item in array”. The problem is compatibility and modern features (animation, camera support, maybe location-awareness). I suppose you COULD say “Firefox version N is my IDE,” but the code will work improperly on other modern browsers, and probably won’t work on anything older.

    Also, most Javascript programming references are oriented towards the goal of “Making web pages that work well on multiple browsers, even including IE6” — which is a skill that no child should ever be exposed to.

    1. I was just reminded of these people: http://www.bootstrapworld.org/ — Bless their souls, they are helping middle-school kids make real games in Common Lisp. 

  18. I’m not sure I’d rush away from Scratch at age 8, it’s quite wonderful for getting kids interested. 
    My 7 year old lad is just getting into it, and I love this as I teach Scratch to teachers in Ireland (so they can teach Scratch in their schools). My main job is lecturing computer graphics programming to college students (both coders and non-coders), and we use Processing for that, and it is a wonderful language, as mentioned above by several commentators. 

    Shameless plug: If you feel Scratch is too basic for your young coders, perhaps some advanced topics such as programming the Kinect with Scratch would keep them interested? I wrote some free software that lets kids (or anyone) easily connect up Scratch to a Kinect, I’m giving a workshop on this at the Art && Code conference in CMU next month: http://artandcode.com/3d/workshops/2c-teaching-kids-programming-with-scratch-kinect

  19. I’ve also been thinking about this.  I like the ideas behind Alice for storytellers, http://www.alice.org/ , but I’m not sure I like the whole package.  I’ve been meaning to take a closer look at Kojo, http://www.kogics.net/sf:kojo , but haven’t had the time as yet.

    I think there are actually three separate parts to this question:
      – How do you want to do the teaching?
      – What language do you want to use?
      – What libraries are available?

    These three are obviously related.  The languages and libraries available will have a huge impact on what teaching styles are easy.  I think the most important thing is that the kid is doing something they are interested in, not just ‘learning to program’.  Storytelling looks to be great for some kids.  Writing games looks better for others.

    From a programming perspective, you want something that allows fast turnaround.  Something with a REPL (read – evaluate – print loop) is useful.  But you also want something that is going to encourage good programming practice.  Python is great for the REPL, but is only OK as far as encouraging good programming practice.

    Libraries are really important because if you make the whole thing too much work then nothing will happen.  You don’t make your first model airplane an intricate one – just gluing on the wings is fine.  There is time to get more elaborate once they’re interested.

    I haven’t seen anything yet that has the perfect trade-off between these three aspects…

  20. This isn’t for those who want to do the text-based route, but for learning concept without the pain of syntax, Stagecast Creator is a great option.  It hasn’t been updated in a while, but it’s still a great program.

    http://www.stagecast.com/

  21. Check out Illumination Software Creator. It looks interesting, and might be fun for kids. It’s not free, but maybe if enough money gets thrown at Lunduke, he’ll finally stop plugging it on the Linux Action Show, and actually open-source it.

    http://radicalbreeze.com/

  22. Another vote for ‘Invent With Python’. My 10 year old daughter, who is interested in making games, bought this with her own money. We’re working through it. It focuses on game building for kids (anyone, really) with no programming experience. 

  23. I learned on Turing, which is an older language that you can’t do much with, but it made sense.
    I learned Java right afterwards, and OOP is harder to grasp than straightforward stuff. 
    If you do decide on Java, look up Ready to Program java, there are free downloads available and it gives you the basic structure.

  24. Last year, one of my (very talented) parents came in and taught html and a bit of java to my Grade 5/6 gifted class using Hackasaurus (http://hackasaurus.org/). The kids were engaged and had fun being silly remixing web elements. If you haven’t checked it out yet, I think it’s well worth the time. 

  25. Well, I learned on APL: which has a much lower threshold to get started than even BASIC does.  For example you don’t have to explain how “=” actually means “assign” because “assign” is an intuitively obvious left pointing arrow “a <- 5".  Equals, "=" is (surprise!) a test for equality. Nothing is even slightly typed so you don't get nagged about little things like an array whose  elements are "4", "5.67", "Fred" and "π".  Graphic manipulation and OO are pretty trivial there too.

    Having said that, I don't know how practical it is these days to get it running on your home computer.  Plus it's the ultimate typographical mess.  Most tellingly, it has no syntactic resemblance to *anything* except "J" so you're not going to get a leg up on any other way of doing things. Still, it could be a spiffy way to demonstrate every single computer science concept and programming paradigm (including several that only APL can do at all) without having the syntax get in the way at all.  Then you could switch over to some other language that has these things called "restrictions" so that your code can be modified and tested by other people.

  26. Stanford’s CS 101 (sort of a programming for poets class) is a nice resource, not for young kids but maybe ages 12+.  It uses Javascript.  You write it and run it right there in the browser as you go through it.  Most of the early exercises involve image manipulation using simple functions provided by the page.  And it includes tutorials on other aspects of computing–hardware, networking, etc.

  27. The Little Schemer is a great book and may be combined with Dr Racket (formerly Dr Scheme) for learning in a context that should teach more elegant design patterns by default and could eventually be extended to more complex software (gui, etc.)
    http://racket-lang.org/

  28. My daughter (age 10) and I have been working through a relatively mixed bag. Scratch for sure. We’ve been steadily working through Python with Sande’s Hello World! book mentioned in another post. We’ve also explored Processing using a couple of Raes and Fry’s books (not to mention breaking and fixing all of the code available at openprocessing). Ditto Lego Mindstorms. And now she’s somewhat keen to dig into some Kinect/Cocoa projects I’ve been doing on campus. I often worry that she may be distracted/hurt from all of the bouncing around. But, each environment has very obviously different outcomes that all seem to keep her both interested and challenged. Kids are surprisingly resilient and elastic. I can see the neurons firing away and she’s shown remarkable creativity in all cases. If anything, I’m learning a lot from watching her move in and out of each. Intrepid indeed.  

  29. I’ll throw out my lesson plans as a k-4th grade computer teacher.  We start the programming concepts in 3rd with flowcharts and Scratch, each student making their own game, and this year they will be doing html to give their game page a look and feel.  For 4th grade we do http://inventwithpython.org and gamesalad to do iOS based games.  Now that MIT Media Lab is home to Google App Inventor, I’m watching to see what they do with it.  By the time they leave, they have a foundation to approach most major languages and know the concepts, they’ll just hash out syntax and protocols.  Our upper learning students do java, objective c, c++, and have no problem.

    We also do an after school program using LEGO Mindstorms NXT.  The Mintduino kits are being evaluated for next terms offering.

  30. Flex / Flixel may be a good choice. A little bit of set-up is required, but it’s pretty simple ActionScript coding from there.

    Python is another good choice. I’ve used PyGame for 2D games but I found it was overly complicated for the results.

  31. I agree strongly with Processing. Being able to connect the concept of objects to “moving pictures” is a powerful learning device at any age.  Imagine the sparks that will go off in her little head when she learns how simple agents like “ants” can be programmed to interact and make complex behavior and motifs (like an ant colony).  Moreover, being able to hit the “play” button at each step to see what you have got is great trial and error learning.

  32. I’d suggest Perl, if only because children need to realize the world is a grim and often confusing place.  Perl, much like life itself, teaches that pain is inevitable. 

    1. Perl’s “write-only” syntax also teaches a child the valuable lesson that communicating with others is futile. They’ll never understand you. Never EVER. So why bother, man?

  33. Old timer here (wrote my first program – in Dartmouth BASIC on paper tape) in ’65. I was a programmer for >25 years in tons and tons of languages (from assembly to “4GL”s). Once I discovered Python, I used it every time I could. The best language for logical / mathematical thinkers. (Ruby has similar aesthetics.) Alice is somebody’s (from Carnegie Mellon, iirc) attempt  to correct “flaws” in Python. 

    Back in the 80s I discovered an Osbourne book, which went through (registers, microcode) how a virtual 6502-ish CPU actually works. That’s when I really grokked programming. I’m sure it’s long out of print, and I’ve never heard of anything like it since (creating a Turing “machine” by hand comes sort of close). But that’s me.

    JavaScript requires books at hand and  the occasional sacrificial chicken, but you can make semi-cool visible things happen pretty quickly (browsers take care of an awful lot of the messiness of doing a UI). 

    1. I remember that book.  My library had it for some reason.  It actually helped me understand 6502 register manipulation.  With 4096 bytes of RAM to work with you needed every efficiency you could get.

    2. Noam Nisan’s “The Elements of Computing Systems: Building a Modern Computer from First Principles” is sort of like that. Didn’t truly grok computer programming until I understood its substrate.

  34. The activities that run on the XO laptop (from the One Laptop Per Child project) are available for free and include several activities that teach programming skills (Scratch, Logo, and some that teach Python).  The activities themselves are written in Python, so it’s possible to modify them or create new activities.

    Sugar Labs, responsible for software for the XO and some of the activity development, has free downloads on their website: http://www.sugarlabs.org/

    Sugar is the desktop environment on top of a Linux distribution.  If you download “Sugar On A Stick,” you can boot off a USB thumb drive and run the software without installing it on your computer. The interface is set up with children in mind. It’s colorful, simple, and charming.

  35. I’ve been using Star Logo TNG with some 14-15 year olds.  Similar roots to Scratch,  but gets to more programming concepts.

    From the StarLogo TNG FAQ:
    What is the difference between Scratch and StarLogo TNG?

    Both Scratch and StarLogo TNG share a common heritage with LogoBlocks,
    a tool to create programs for Crickets. The two tools are written from
    entirely separate code, but we do share ideas. The audiences are
    different for the two products as well. Scratch is primarily designed as
    a tool to make computational multimedia projects for kids, targeted at
    Computer Clubhouses. StarLogo TNG is designed for more formal education
    environments such as introductory programming classes, or subjects (such
    as biology, chemistry, physics, etc.) where modeling is an important
    part of the curriculum. They’re both interesting tools, and you should
    check out Scratch when it becomes available.

  36. At one point in the early 80s I could do simple patches to S360 code directly in machine code (with a hex editor). And (back to Rob), 68000 assembly was very similar to S360 assembly – pretty straightforward. Intel assembly, by comparison, was inspired by HP Lovecraft.

  37. I wouldn’t worry about starting kids on a “real” language.  I taught myself hypercard (of all things) in jr. high, played with it for a year, learned C from “C for Dummies”, and took Java classes in highschool and college.

    Starting with a useless, easy to use language is okay.

  38. thanks, didn’t know about Colobot.

    total votes for Scratch. Kiddo ( you met, Mark, years ago at a signing at the Exploratorium, along with public figure Mombot. ) has been using it since he was ? 6? At 13 he still uses it. infact he was using it while we were Barcelona last week to try and recreate some android games from his phone.

    He didn’t yet make the jump to StarLogo NG or the Android Explorer kit, altho I think he’s about due. He found the mindstorm stuff droll.

    Scratch for Arduino variations, however, do seem to be calling.

    one which hasn’t been mentioned is Unity3D. The free version allows behaviors in a number of languages including a variant of javascript.

  39. Not everyone ‘gets’ every language.  I was a mainframer for 20 years.  COBOL/CICS primarily with a bunch of other batch stuff like Easytrieve.  But I never ‘got’ RPG.  Made no sense to me at all.  Just a weird parameter driven batch mill with a logic cycle that was hostile to whatever I wanted to do.

  40. How about something more radical – Flash! Action Script-driven Flash would provide a great environment with lots of graphics, Internet-interactivity, and real OO programming, all in one.

    1. Agreed. ActionScript is a nice language. Probably next if Xin Mei’s interest in programming continue.

      We always started with Applesoft BASIC. It is enough to teach simple things like graphics, loops, branches and variables.

  41. Look into VPython. It is basically Python with a graphics addon that makes animations completely painless. It is basically Python with a huge add-on library that takes care of all the boring shit in animation — setting up camera views and lighting angles and describing objects — so you can concentrate on making your objects move. You get instant visual feedback on very simple ideas. You tell it to make a red ball and where the ball should go and it takes care of all the rest.

  42. BAFTA has recently released a game creation platform for kids that’s based on Unity 3D. It’s called Games Unpacked. http://ygd.bafta.org/games-unpacked

    This might be a good gateway between the drag-and-drop stuff in Scratch and coding something in Unity – which supports JavaScript, C#, and a dialect of Python named Boo.

    Great thread. I’ve recently been preaching to my friends and family that they need to teach their kids to code. Now I have some new resources to help convince ’em. (^_^)

  43. It’s all very nice & cool but please don’t let kids sit in front of those hissing and flickering ancient monitors. Just run an emulator on something that can support lcd screen.

    1. Mmm… our Apple IIGS monitor don’t flicker or hiss. However, it only last for less than half an hour before it started to get blur.

  44. If you have any familiarity with Hypercard Runtime Revolution’s Livecode is basically a modern version of that. I’ve found it’s very easy to get kids into it since it’s very english-like and relatively easy to understand.

    1. I agree. I taught my son to program on LiveCode; now he is teaching himself C++. LiveCode has all the advantages (but hardly any of the disadvantages) of Hypercard. Hypercard was released just after I  finished a minor in computer science (hardly anyone had their own computer): I could already program but, man, that was a lot more fun than any other language I had ever used, and I loved it! Hypercard did have some really stupid limits but if you just wanted to finish something that actually worked, it was great. LiveCode is too.

      Did anyone mention http://projecteuler.net/ yet? We worked our way through that; it is good for geeky kids.

    2. Hypertalk was a terrific language, the most English-ized programming language ever. You could use expressions like “the second letter of the fifth word of the ninth line of field Description”. The equivalent code in any other language you can name would contain more functions than a swiss army knife. And it ran just great on my old Mac Plus. Oh, those were the days…

  45. 72 comments and nobody has mentioned the longevity of the IIgs?

    I had one in 7th grade. I’m, 37 now. That’s 25 years. Nice Machine, Woz.

    1. Yes! Finally someone on Apple IIGS! I have 3 in my house (although one is not working).

      Apple IIGS is a great computer for teaching kids programming. All my kids learned programming on the Apple IIGS (Xin Mei is my youngest daughter).

  46. Greenfoot is a great tool for teaching Java: http://www.greenfoot.org/If you find that the jump into script writing is a bit too much for her, you should check out Alice: http://www.alice.org/Alice is drag-and-drop, very similar to scratch, but it’s made specifically for introducing Java and object oriented programing to students with no scripting experience.

  47. Wow, the comments are good resources. I always thought my kids Applesoft BASIC first (since I have Apple IIGS in my house), then see whether they are interested or not. My son goes on and learned Pascal (Complete Pascal on Apple IIGS) and went on to become an iPhone developers at 9 (http://en.wikipedia.org/wiki/Lim_Ding_Wen).

    Xin Mei is now starting to learn from her brother, and if she is interested in programming, her next language might be PASCAL or ActionScript.

  48. For me it was HyperTalk in HyperCard, on a Macintosh Plus. I was 10.

    On MouseUp
    Wait 1
    Go to card “Nostalgia”
    End MouseUp

  49. Mark, you’re assuming you can judge a priori which language she’ll take to best when you don’t even know if she’ll enjoy text-based programming at all. Why not throw all preconceived notions out the window and introduce her to two or three so she can decide? With its ultra-simple syntax and lack of weird operators, BASIC is and as good a choice as any. At this early stage you shouldn’t be worrying about things like having her avoid spaghetti code. Who can argue with:

    10 PRINT “HELLO, WORLD!”;

      1. That was force of habit from many years of Pascal, C, C++, Perl, PHP and other languages that terminate statements with semicolons.

        In the BASICs I’ve used, semicolon is used for string concatenation, e.g.:

        10 LET A$ = “HELLO, ”
        20 PRINT A$; “WORLD”

        So my example still would have worked just fine with the superfluous semicolon.

    1. I agree! Once you know one programming language (and Scratch counts!), learning other languages becomes much easier. I learned at least 5 programming languages before I was in college and have learned many since and every single one has made me a better programmer in some way. Every language, and even every dialect, has its strengths and weaknesses.

      Would definitely agree with the sentiment that you should find something that lets you get things on the screen quickly–I only became any good at maths cause I realised it would help me make better crappy games on my BBC Micro. :)

  50. 6502 assembly, yeah, that would be a real merit badge! My first programming language was FORTRAN, yes, punched card decks. Sheesh.

    Back in the 80’s I created a proprietary kid’s first programming language called KIDBASIC for Mattel’s Children’s Discovery System, a membrane-keyboarded, LCD matrix screen battery operated toy computer. Really cute and fun!! Kids could very quickly design their own games.

  51. Here is a link to some cool coding lessons in C#.  http://msdn.microsoft.com/en-us/beginner/bb308756.aspx
    My kids like to play with Visual Studio express. It’s free and you can get a version that will allow you to create games they could even run on a Windows Phone.
    Install the tools, show them how to start the tutorials that teach them how to create a simple layout and add features.
    It will go by so fast. Before you know it they are asking how to capture events and communicate with other devices.
    Some children may not be interested or have the patience and that is OK! But software lends itself to a massive universe of possibilities and if the system is off the net the worst is having to restore from backup.

    http://www.microsoft.com/visualstudio/en-us/products/2010-editions/windows-phone-developer-tools

  52. On the other hand, one must always consider the thoughts of Dijkstra:

    “I think of the company advertising “Thought Processors” or the college pretending that learning BASIC suffices or at least helps, whereas the teaching of BASIC should be rated as a criminal offence: it mutilates the mind beyond recovery.”

    or,

    “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.”

  53. A little over 20 years ago my father stormed in the house on Christmas with a brand new TRS80 (Tandy Color 3 – The white one), it was a business gift. Setting it up was a blast, I could sit in the boxes. It came with a programming book as well as some primitive form of BASIC on a floppy disk. The book had honestly about 600 pages of code for each program, often 20 pages of gibberish to do something very simple. With my father’s guidance, my little fingers typed character by character, pages and pages of code, often taking an entire weekend to complete.

    The result of my trial and error? 4 sequential flashing colors! With bright lights on my pupils, I was dazzled. The next weekend was spent figuring how to make the colors different.

    I didn’t have to learn BASIC so to speak, I was too young to understand the math, the book did that for me though. It opened the door of trial and error, reward based computing. When I grew up a bit, I got a Macintosh SE and my habitual need to take things apart was usually revolved around using ResEdit to toy around games inner workings. “How can I give myself 99 lives in CrystalQuest? Hmmm..” Years later, in highschool I found myself in a programming class writing my version of Asteroids in C++, although I did not have a book to copy from, the exploits of my early Tandy tinkering helped a lot. I could have used a book for that blasted intersect function though, ouch.

    I am horrible at math, luckily there is enough out there that doesnt require it and rather stimulates that tinkerer buried within all of us. My suggestion, something that uses a book or reference to start with a flashing reward at the end, the quest for more colors will never stop after that.

    1. Oh, yes, I have fond memories of the TRS-80 Color Computer. That’s what I cut my BASIC programming teeth on as well– in my case, it was through tinkering with programs from Rainbow magazine, back in the days when you had magazines full of source code. I still think, to this day, that this is part of the reason I like the whole open-source movement.

      I still have that computer in my closet somewhere. I ought to get it out again, but honestly, it’s just as easy to emulate it using MESS…

  54. Programming is really three core disciplines rolled into one field.

    The first, what I call type zero programming, is the mathematics that applies to computers. Mastering this type means mastering algorithms, data structures, and logic, among other things.

    Type 1 is the language level. To master this level you need a good understanding of a language, any language. You need to know syntax, how the compiler works, how you make your program work on a different platform, etc.

    Type 2 is the library level. Mastering this level involves learning the standard libraries that come with your language, learning how to integrate third party libraries in your programs, learning how to debug code you did not write, and other things along those lines.

    When teaching anyone programming, it helps I’ve found to put problems students are having into the proper context. Program won’t compile? That’s a type 1 issue. Struggling to understand what parameters to pass to int drawWidget()? That is a type 2 problem. Program running slow because your collision detection checks every object twice? That is a type 0 problem, etc.

    In my opinion, curriculum and languages should be chosen to make learning type 0 as easy as possible, but it is a delicate balancing act. If your libraries do everything for you, it becomes harder to teach type 0, and hence harder to teach real programming. But of you use a language and libraries that force you to have type 0 concepts down before you even start, the student will get frustrated and give up.

    If you have a student who really loves math in the abstract, don’t start with any language, don’t even give them a computer. Teach them about logic gates, algorithms, and data structures. Teach them what a computer IS. Most people (even many programmers!) don’t know that. They will then be able to take their pick of any language, even the hardest ones, and they will excel. 

    More realistically, if you have a student who doesn’t like math, but is interested in computers, find a language that does not abstract away too much of the type 0 work, but is still easy and safe to use. Python as a language has lots of nice syntax for working with algorithms, but has a strong disadvantage in that you need to get heavy into type 2 before you can get past the command line. I thus recommend, with some hesitation, Java. Primarily for its built in graphics libraries and data structures, and the fact that it is safe(ish) for first time programers. Though you should try to advance your students to a (true) compiled language as soon as they can handle it.

  55. An interesting book to read might be Mindstorms: Children, Computers and Powerful Ideas where Seymour Papert proposed a constructivist method for educating children using computers:http://www.amazon.com/dp/04650…I think the browser is a great platform for learning (You can even use web pages as a play ground through developer consoles, Firebug etc) and there is a recently released Smalltalk environment the runs in the browser:http://amber-lang.net/Smalltalk was also designed by Alan Kay to educate children in the style of Seymour Paperts methods, but long before Paperts talked about them:There is a nice introduction lesson:http://amber-lang.net/learn.ht…Coffeescript is also great simple language you could use the Cloud 9 online editor, might take a little setup though.

  56. I would like to encourage anyone trying to teach programing to kids to take a look at http://vvvv.org/ – it is a graphical-paradigm programing language (a là MAX or PureData).

    I have found that graphical programing languages are much easier to explain, and the fact that vvvv is “always on” (there is no compiling, all the changes you make are live) makes experimentation very rewarding.

    And it has a pretty nice advantage as a teaching tool: it’s main interface allow you to also program in c# and HLSL (a shader language), and while both are probably beyond the younger kids, the fact that it is there allows for a transition into objet oriented programing. 

  57. There’s an educational version of SmallTalk called Squeak that offers a nice balance of text and drag-and-drop programming to beginners.  http://squeak.org/

    A sister website, http://www.squeakland.org/ is all about learning to program with the system using their “eToys.”  

    Did I mention that Squeak and the eToys are part of the One Laptop Per Child campaign?  http://wiki.laptop.org/go/Etoys

  58. Well… I honestly don’t think it matters that much what language you use. Choose something you are comfortable with, and something that one can actually produce something with in short order. I went with C# for my 8yo daughter. What I want her to learn is how to think like a programmer. What I saw with many of my friends was that although they were able to produce some small programs, it just never clicked for them. Programming is a way of thinking, not just adding commands.

    Oh, and I would also vote for Lego Mindstorm, they have an amazingly easy interface, that still has everything a programming language would have (yeah, mine is still on top of a book case… need to start working with it with my daughter) and you get instant feedback. Logo… I was bored out of my mind with it after a few minutes… but that was 25 years ago, perhaps they have done something with it meanwhile, though.

  59. I think Javascript is probably a pretty good choice because it’s everywhere.  But I wouldn’t suggest jQuery for learning programming.  jQuery comes up for cross-browser compatibility and for sharing code with existing Javascript apps, not for learning to program.

      1. Hmm… well, Oberon sure didn’t manage to make me all hot and bothered when I was introduced to it um… 17 (or so) years ago. It had some interesting concepts, but to me it was just a big disappointment and I just didn’t like it at all. I guess there are newer versions now, though.

        Modula-2… well… it is a “clean” language, nothing extra or fancy. Good teaching language, but I’m so glad I don’t have to touch it ever again!

  60. I have fond memories of learning to program with LOGO and BASIC on the Apple II. I’ve also been wondering if my 8-year-old might enjoy learning to program, but she’s not very good at reading (in English) yet. Any suggestions for pre-readers?

  61. I always recommend “Learn to Program” by Chris Pine. If I ever meet the guy, I’ll give him a high-five. Its a fantastic book and I generally keep about 5 physical copies at my house, so that when someone is saying they want a change in career, I can give them a copy. I always keep having to reorder them! Anyhow… fantastic book!

  62. I do not know which language is best for learning. As others mentioned, I’ve heard Scratch and Alice are good for younger people.
    I do believe that learning (anything) should be interesting and fun, otherwise people get bored and quit. With programming, I think we should be able to see or hear what we create, and that we shouldn’t have to wait much between doing a change in a program and seeing what effect it has.For me learning programming was fun. I was playing with the sin() function (sine in trigonometry)  without having any idea what it represented, only that it returned numbers between -1 and 1 and this allowed me to create really awesome graphics. Playing with programming gave me a understanding for math, geometry, animation, timing… I hope I or someone else can transmit this to people willing to learn.I have started creating some videos teaching Processing http://funprogramming.orgThere are several reasons why I chose Processing. You can write a one line program that draws something on the screen. If it’s short, it’s less scary. It’s quite fast and powerful, allowing you to go from drawing one pixel on the screen to using 3D, sensors and external controllers. You can easily share you work online with your friends, you can run your programs on Android phones. There is a large community of teachers, artists, good documentation and lots of examples online. The syntax of Processing programs is similar to other mainstream languages like JavaScript, Java or PHP, which is good if one decides to try them out.

  63. Beware of people who say that kids must learn strong typing and OO (or LISP and vi) from the start if they want to be a REAL programmer.  Bitterness and learning don’t mix.

    If someone’s ever going to be into coding, it’ll start with them enjoying the process.  Who cares if they can’t immediately create dialog boxes?  The specifics of the tool don’t matter– every environment has its peculiarities and sticking points– you just want to be able to make the computer do what you tell it to.

    I’d add my vote for Processing, because it’s designed in exactly this spirit.  It doesn’t try to disguise the nature of programming, it just makes it as quick as possible to get past all that to the interesting part, which is making the computer draw a picture.

    (I haven’t yet tried the new Processing.js, but that may well be even better since it has the looser syntax of Javascript)

  64. It’s a bit of a different angle, but can I chuck Inform7 into the mix? http://inform7.com/
    I think it is genius, it is a tool for programming old-skool text adventures/interactive fiction, but instead of code you program by using complete english sentences. For example to create a hallway with a ball in it you would type

    ‘The Hallway is a Room. The Ball is an object. The Ball is in the Hallway.’

    .. hit ‘compile’ and it you have the start of a playable game! It’s a great way to help young kids get the idea of giving a computer instructions and have the computer do them.

  65. I know I’m way late on this, and you’re never going to read it, but one great thing about Scratch is the Picoboard: http://www.picocricket.com/picoboard.html

    It’s basically a simple, kid-friendly Arduino. It has several build-in sensors, and is programmed directly using Scratch. A great way to get the kid interested in programming robots!

    I wouldn’t give up on Scratch just because it’s not text-based. Understanding the structure of a basic program is much more important than learning a specific syntax.

    And you can actually do pretty impressive things with Scratch. When I first learned it during a workshop at MIT, I created a little sprite that could follow a path and find its way out of a maze within my first hour with it.

  66. I think scratch is a really compelling environment for teaching programming. Even college-level courses use it as an introduction, and it is surprisingly capable. For older kids I would agree with those who suggest javascript – it is a very capable language with a lot of support. One of the really nice things with js is that since it’s an interpreted language, feedback is instantaneous, and errors are easily visible onscreen without the need for complicated debuggers, etc. 

    jQuery makes fancy graphical effects and complex loops/selection really simple. 

    As the world moves more and more towards web/cloud-centric applications, web technologies are increasingly important for kids to learn. Nothing wrong with python, but I would start with js/html/css before server-side languages…

  67. That’s a lot of comments! I guess there are a lot of programmers reading BB?

    Recently I made a website together with another individual where you can learn Python in the browser.  The grading is done remotely and integrated on the same page as the instructions, with several different kinds of exercises. It is here:
    http://cemclinux1.math.uwaterloo.ca/~cscircles/wordpress/
    It is meant for beginners.

    On the other hand, I commend one aspect of the JavaScript realm, that you can start playing with graphics in the browser from the get-go. The new free Stanford CS 101 course has a bit of this but I did not find the whole course to be well-rounded yet.

    FWIW I learned on Pascal but find it hard to get good tools.

  68. To some degree the language does not matter. What matters is that the kid is ready for the abstract thinking required for programming and that he or she wants to program. My son, then 10, spent a week programming w/ Scratch. He enjoyed it but then abandoned it because there was no relationship between his life and what he could do within Scratch. If Scratch connected to the outside world (think Maker here) he would have continued further (I think). Kids think of programming like drawing a specific picture or building a play structure. I do it now and I am done. For them, it is not an intellectual journey.

  69. I’m bookmarking this to read later; it’s a topic I’ve thought about occasionally since we had kids. When I learned to program in the 80s it was BASIC and so that was my first thought too. These days my husband and I use many different programming languages as part of our jobs, but I’m not sure what I think would be best. I somewhat lean towards PHP because you can do lots of pretty cool things with it early on and it’s pretty loosey goosey on the structure … I can see it having some real-life meaning to our kids when they’re a bit older. Also, free is good.

  70. Funny thing is I also learned programming at an early age. (I think I was 6 or 7) My father simply gave me whatever books he had lying around on the topic.  I don’t think there are many “kids” programming books out there and the “adult” ones are usually written on such a basic level that if a child is actually programming then they can pick it up pretty easily.  Kudos for supporting this.  :)

  71. hackety-hack.com has a cross-platform (Mac, Win, Linux) Ruby environment designed for children with lots of instructive guides and a heartwarming sense of humor. Lots of visual output including a Logo-like Turtle.

  72. Microsoft’s published a programming language called Kodu out of their research group for this purpose: http://research.microsoft.com/en-us/projects/kodu/. They bill it as a visual programming language for creating games. I personally learned on LOGO when I was 4, but this seems like it would have been a bit more fun than drawing a star over and over again :)

    Neil

  73. I would suggest that part of the overall package should be a spreadsheet. MS Excel or OO Calc will both do. For the ‘math’ part of programming, a spreadsheet is essentially a functional programming system. Moreover, because of the immediate visual feedback, it is very easy to break up a more complex problem and solve it incrementally. Moreover, the parallelism of many spreadsheet style solutions offers a view of the problem that can be hard to see inside a classic debugger.

    For those pushing the boundaries, they can step into the macro language.

    The other nice side effect is that spreadsheets are a tool far more likely to be found on the average business desktop. I’ve gone as far down the stack as building Windows services — but leveraging the spreadsheet often provides a much bigger bang for the time invested.

    My longer term perspective, however, is that many of us incurred a huge benefit from walking up the programming complexity hill at the same time as that hill was created for microcomputers. I taught myself 6502 assembly in order to rewrite a video controller to run a favourite game — thus teaching myself assembler, machine code, hexadecimal, and some hardware fundamentals all in one shot. I had an early copy of Turbo Pascal (for CP/M!) and used it on my first consulting job. When I learned COBOL, I was taught the underlying memory meanings of both COMP and COMP-4. I’ve also learned about digital logic, discrete hardware, analog circuitry, and semiconductor device physics. I know why there I had increased CPU temperatures running SETI(at)Home.  I don’t usually have a problem with metaphor shear – when the model for the current layer breaks and exposes the guts of the next layer down, I can deal. The funny thing is – so can a lot of people my age. But I do not get the impression that anyone whose first exposure to a computer was a Windows XP signon screen will ever have that depth. They haven’t lived through the revolution.

    As a parent, there is a problem here with no good solution. Much of what I learned was practical at the time. Now, for me, it is part of my pyramid of knowledge. But for someone new, it’s going to be history, not practice. I don’t think my kids will learn about computers the same way I did. Like Mark, I’d like to know a good way to teach both breadth and depth – but starting at the bottom like I did probably won’t be a good way to do it.

  74. And on that note, I just realized one reason why I like Python so much: just like the old-school BASIC that I spent much time with as a kid, there’s an interactive console, where you can write functions and play around with them on the fly. It really does help with learning the language and all of its features– and although I’m quite familiar with the syntax by this point, the interactive console still helps with learning how various built-in functions in the API work even now.

  75. Another hearty vote for Python! It’s truly a fun language to use and can be taken from a simplistic linear or function-based level to full-blown object oriented methodologies. She’ll learn valuable concepts that she can apply to other languages in the future should she wish to branch out.

  76. I’m in love with this thread! When I get time, I need to go through and write myself a little digest of the options and their pros/cons to distribute to other parent friends of mine!

  77. Scratch is a good way to start, because it teachs you the logic behind programming, without worrying about the quirks of any language. After grasping the concepts, I’d move to Processing.

  78. Great article, Mark, and interesting follow-up discussion.I lead the Kodu team at Microsoft Research–Kodu Game Lab for the PC is a free program which kids learn concepts around computer science (or more generally, computational thinking) while building their own 3D video games.

    I have taught hundreds of children in classroom and extracurricular environments, some as young as five years old.  Everyone has been able to make games, and the youngest I’ve taught weren’t even reading yet(!).We’ve made an extra effort to appeal to both girls and boys with creative design aspects and stortytelling capabilities in addition to typical shooting and explosions.

    You can see more at http://fuse.microsoft.com/kodu, or feel free to contact me if you would like to learn more.  We are engaging kids and educators in the classroom throughout the country and around the world.We ran a study in 2009/2010 in Australia; you can read about the incredibly positive results here: http://csamarktng.vo.msecnd.net/kodu/pdf/web20_technologies_in_the_classroom_kodu.pdf

    If you have any questions or would like to know more, please feel free to reach out to me at bradleyg@microsoft.com.

    1. Ooh, that does look interesting. I will definitely download it and install it for my daughter!!!

      One line that caught my eye: “Kodu demonstrates that programming is a creative medium”. Thank you, thank you, thank you, thank you!!!!! This is something that I have been trying to tell people, and that I think is so important to point out especially to girls. I see so few other female programmers, and more or less no other female game programmers! Girls seem to look at programming as something technical and therefore do not even want to try it, when in my opinion it has nothing what so ever to do with technical stuff. Math and logical thinking… sure, but it is foremost a creative process, and I think girls and women would have so much to bring into programming and especially game programming (well… it’s my branch, so…).

  79. I think programming is a valuable skill, but I don’t think I really want my kids to become programmers. It seems that the world has turned a bit, and programmers are the new sweatshop workers of the world, the techno serfs. Not a really a good career choice.

  80. I think it’s more about getting kids into that kind of logical thought process, but also the more languages one knows the better, and that totally includes programming languages.

  81. There’s a BASIC app for iPad now. It’s … well, you know, BASIC. But it does seem to work. (You can’t compile iPad apps with it, though; it’s more like a script executor that runs in an app shell.)

    Still, not bad for a buck.

      1. Looks like a fairly late-game BASIC, though I haven’t had any time at all to seriously explore it. For what it’s worth, here’s the link to the iTunes store description:

        http://itunes.apple.com/us/app/basic!/id362411238?mt=8

        They talk about sprites and facial recognition (!), so my guess is that it has at least some graphics support.

        There’s another one called HotPaw BASIC that claims to work on both iPhone and iPad, but it costs five times as much as the other one:

        http://itunes.apple.com/us/app/hotpaw-basic/id295464266?mt=8

        The miSoft BASIC! app will let you load and run your own files through text documents, for what it’s worth.

  82. $ python
    Python 2.6.5 (r265:79063, Nov 12 2010, 00:52:45)
    [GCC 4.4.4 20100525 (Red Hat 4.4.4-5)] on linux2
    Type “help”, “copyright”, “credits” or “license” for more information.
    >>> import turtle
    >>> turtle.forward(10)

    Python has a logo-like module called turtle. You get the nice graphical logo features and the object oriented approach of python. Very nice indeed for kids.

    1. Wow! I just tried that and it’s great!

      On that note, I’m surprised no one has mentioned NetLogo. It’s an agent-based “multi-turtle” logo, which is actually really great for creating simple (and complex!) models and simulations. My company has created lots of models using it — global warming, predator/prey dynamics, etc.

      It’s actually aimed at kids programming, and agent-based modeling is a really neat concept to get acquainted with.

      And one of these days, one of these days, it’s going to be open source (or so they keep saying).

Comments are closed.