Hacker News new | past | comments | ask | show | jobs | submit login
Ask HN: Teaching programming to a 10 year old, and I'm kind of lost
42 points by newsisan on Sept 5, 2010 | hide | past | favorite | 50 comments
Basically, I was wondering what would be the ideal introduction and flow to teach this - ideally it would start out easy and the more engaging the better! Obviously it makes no sense to try and force something if the kid isn't interested, so help me make it interesting and easy to understand!

I was thinking

-Scratch or Alice for the basic concepts

-Then either learnpythonthehardway, diveintohtml5, diveintopython3, ruby+shoes (hackety hack) (thanks to the respective maintainers/creators of these apps/sites)

Any comments (with or without experience) would be appreciated greatly, as I am unsure which of these would be most appropriate for a complete beginner, or whether there is something else that would be more suitable.




A couple of random thoughts:

When we got our first computer, my then husband was excitedly explaining to me how to do stuff on it. I stopped him and said 'Where is the on switch??" My point: You may need to scale things back to where she is from your current vision.

Also, I recently showed my two sons a little html and css. My oldest has been wanting to learn a programming language and not finding anything intelligible for the way his mind works. A few minutes of demonstration and the light went on as to what kind of info he needed, which he promptly began looking up. We also used analogies using video games to provide some mental models for it. So if you run into any hitches, consider trying to adapt to her learning style and using something she is familiar with to provide examples.

Good luck. And I still want to learn a programming language, so would love to hear how this goes.


Umm well if you have the money go for lego mindstorms, if I was a kid again I'd want to play with legos and robots. (Hell they are still cool)


And if the kid gets bored of the visual programming language that goes with Mindstorms, try setting up NQC for him/her:

http://en.wikipedia.org/wiki/Not_Quite_C


You need to be a kid to play with lego (or mindstormers)?


Step 1, learn to elide almost everything except what you're actually teaching. This is surprisingly harder than it sounds and often involves saying things that are technically untrue.

Step 2, teach the things required to do tasks.

For a child, you should focus on things that they can understand the output of. Sound, animations, pictures. Turtle/logo is a fantastic platform in this regard.

For, well, everyone, you need to ensure that what you're teaching is what they're interested in. If they're not excited about moving a cursor around a canvas, then they won't learn anything.

You'll know you're teaching correctly when they start doing things on their own that you didn't expect.

Sean


Turn off the computer for a while, use analogies, and remember that children rely on different modes of thinking:

http://carlos.bueno.org/2010/07/corrupting-the-youth.html

http://csunplugged.org/

Also, please email me (in my profile). I'm working on something in this area, and I'd love to have some more kids to use as guinea pi-- er, research assistants.


Hackety Hack still exists http://hackety-hack.com/

I've taught several people quite new to computers Ruby and HTML, I've found the hardest thing they try to grasp is logic, drill into their head how conditionals and boolean logic work - it's needed everywhere.

EDIT: I can't stress this enough, I've had people where I thought I've made a break through, they seem to grasp it, then two weeks down the line I look at some code they're trying to debug, and it's like they completely forgot how flow control and conditionals worked.


Thanks for mentioning it, and thanks to the OP for the thanks. ;)

Hackety is designed for people that are absolute beginners at the moment, and I plan on making more 'intermediate' and 'advanced' things later. We're still pre-1.0 for another few weeks, though, so there still might be a few small rough patches. Specifically, soon it'll just be one program, rather than downloading both Shoes and the hackety.shy.


First, before you ever turn the computer on, you should explain to them how computers work from a high-level that a kid can understand - i.e. how they are dumb, and they just follow instructions that we give them, and how those instructions are what's known as the program, etc.

Then I would suggest starting out with Hello World in Javascript. Javascript is straightforward, relatively forgiving, and it's on every computer, so it's basically the modern-day BASIC in my opinion. Show them what happens when things go wrong, not just when things go right, in order to drive home how computers are really just slaves to our directions.

Then maybe have them start working on a game, one piece at a time. Kids like games, after all. Maybe something simple like Tic-Tac-Toe or a Pong clone. The main advantage here in using Javascript is that they can email it to themselves and then play it anywhere with no need to set anything up - they can also continue to tinker with it on any computer after the teaching is over.


What does the 10 year old want to program? Most likely a game, which is challenging but which fortunately may be satisfied by a working snake or Space Invaders rather than requiring stereoscopic 3d with a physics engine. But a simple interactive graphing calculator can be just as much fun as a game. Tools and diagnostics are good too - instead of teaching arbitrary-seeming practices for problems the kid has not encountered yet, let them run into the problem (eg having to check the dimensions of the window on loading) and write a tool to make the computer do the work.

As a kid, I found the logic relatively easy, and the control structures moderately easy. Abstraction and complex types were the difficult part for me, and I still tend to evolve them by trial and error rather than defining them in advance (though having done so, I usually enjoy refactoring as soon as I have a working prototype).


http://inventwithpython.com/ this isn't a bad book for teaching those simple games.


It's very good - I had an earlier unfinished version. Thanks for reminding me of it, it's expanded considerably since the last time I saw it.


The two vital things you can help a kid with are:

1. Setting tasks that are within reach but will stretch his ability (and getting his buy-in on the idea before you start)

2. Teaching him how to find the answers to his own questions

I'd do all the setup yourself so the kid can jump straight in to producing something. I'd use FTP as it's easy to conceptualize. Avoid the command line and version control.

I'd start with HTML (written in Notepad) so that you can learn to present any data output. Just teach basic tags: h1, p, table, a href. Use w3schools for reference. Build something like a 'My Family' website with a page for each family member and links to the others.

Then maybe stir in a bit of CSS - again just basic stuff (colors, borders, positioning) and again using w3schools for reference. Use this to make the My Family website a bit prettier.

Then try some PHP/MySQL. You could save each family member in a table and use one PHP file to display each one based on an id specified as a get var.

Simple project ideas to try after that could be a simple CMS or (my favourite) a very basic Twitter clone.


Logo worked for me. If you want to teach a "real" language (Logo is practically a LISP! It's real!) then Python has a turtle module.


Another Logo fan here. I still haven't found any other environment that makes me wonder about the power of computers as Logo did. I was 7 to 10 years.


Cory Doctorow called Squeak "logo for the 21st century."

    http://squeak.org/


http://en.wikipedia.org/wiki/Logo_%28programming_language%29 Logo also worked for me as well, I was in the 3rd grade when I started to program with it. It is a lot of fun


Definitely. Learned Logo when I was 7 years old and it gave me all the fundamentals I needed.


I'd avoid Dive Into Python and HTML5 -- both are intended as quick-start guides for those specific technologies, not as general programming tutorials. They won't make a lick of sense without significant prior programming experience.



I wouldn't go quite that far, but it certainly isn't for beginners.


I personally started by learning basic when I was about 9 or 10 years old...thing that got me interested was an open source game I used to play a lot. I accidentally stumbled onto the knowledge that changing the voodoo magic text at the beginning before launching the game (it was written in QBasic i think) managed to change things around in the game itself. If they like games, that could be a good way to start? It gives early rewards, as they're modifying something that already exists. From there I started getting ideas of things I wanted to make myself...and just experimenting here and there.


Wow, I am speechless at the amount I have learned from these replies, thank you all so much - and keep them coming ;)

I am teaching my 10 year old sister, but I don't really know much at all myself - I wish I had back then though, hence why I am teaching her.

She is learning just for the knowledge, with the aim of being able to use it as she needs - inspired by http://news.ycombinator.com/item?id=1299227.

I was thinking of something like this then, from the responses:

scratch/alice->hackety hack->lpthw/invent w python->how to think like a cs/a byte of python->tools/vim/emacs/vcs (?)->google code uni?->django book

Echoing Zed Shaw here (from the link about Dive Into Python, which was extremely helpful for me): what are some decent intros to all the tools used - eg git/vcs, emacs? This is as much for me as it is for her.

Any thoughts on this flow and the choice of resources, especially those with /options/?

hackety hack->?->rails guides? (what would be a similar path for ruby?)

And if this seems to be going a bit deeper than the original scope - it is - I suppose the latter bits are more aimed at teaching me and my brother. I have coded some vb6 before, and he hasn't done anything, but we both want to learn.

For us, we want to learn how to build websites first, so I was thinking:

Sitepoint tutorial (http://articles.sitepoint.com/article/html-css-beginners-gui... (beginner html+css)/w3schools->w3schools for html5/diveintohtml5


My 8 yr old has been doing lpthw with some success. I'm partial to that method since I learned by typing basic listings in from books when I was a kid.


My son started on Scratch when he was 8 and I think as far as looping and conditions are concerned, it's top notch. Just having that understanding of how a computer works through a problem and dispatches messages and acts on those messages is priceless.


When I was 10 my dad taught me if else and how to make dialogue boxes in visual basic. My imagination did the rest.

So my advice is teach something that is practical and understood by the 10 year old. That's the best way to keep him/her interested. No point teaching stuff and telling him/her to have faith that one day it will be useful. That's not effective! You can let college do that later. But right now it's best to show the cool stuff to really get that interest going. So you don't necesarily have to start with the basics. Something cool, show him/her how to tweak it, voilà.


If the kid doesn't seem interested in learning a general purpose, turing-complete programming language (a lot of kids don't at that age), then don't try shoving it down as throat.

Instead, get him into languages that have a limited instruction set. this link:

http://marshallbrain.com/kids-programming.htm

came my way a while ago, and it has a few examples of things that you could use. Light-bot should be a lot of fun for most kids, and it could give kids a good foot hold into greater abstraction.


Take a look at mbed (http://mbed.org). It is designed for very rapid development (12/13 year olds were the test subjects, I think) and so abstracts a lot of the very hard stuff - but shows the basic concepts of microcontrollers. It has the benefit of allowing physical things to be controlled, like flashing lights.

Whatever happened to the expansion ports on home micros that provided full access to the microprocessor's bus? The BeBox's geek port was such a good idea...


I put together a website collecting links to various programming languages/environments specifically targeting children (if anybody wants to make a prettier stylesheet for it, let me know):

http://www.happynerds.net/

Generally I'd advise starting with something interactive and fun, like eToys or Mindstorms. After that a project like Hackety Hack, Löve or Processing might be a good bridge into more "serious" programming. Some people also seem to like the HTML and JavaScript approach, because the development environment (a browser) is available virtually everywhere and it has a very short feedback cycle. I'm not too convinced of that, but YMMV.

Once your kid has the basics down, possibilities are almost endless. There's a plethora of freely available books (legally), of which I compiled a small subset here:

http://citizen428.net/archives/434

I'm also involved in teaching Ruby courses on RubyLearning.org, and while definitely not targeted at 10 year olds, our core Ruby course should be doable for a motivated teenager willing to learn.

Whatever you do, I think the most important thing is to focus on the fun. If kids enjoy what they do, they can learn super fast and will happily come back for more :-)


I learned programming through SilverCreator (http://www.silvercreator.net/?action=downloads) when I was younger than 10. SilverCreator is not updated anymore, it’s only for Mac, the official website doesn’t explain much about it, and there might be a few bugs, but nonetheless it’s a fun game-creation system.

It uses a card-based model where each “card” has an image area and a text area, plus buttons along the bottom, and you can switch between cards easily. You can start the kid off just implementing a guess-the-number game using dialogue boxes or the text area. There are built-in drawing tools for drawing to the image area, so it’s easy to create a simple choose-your-own adventure game and use the buttons along the bottom to switch screens. SilverCreator is made in REALbasic, and the programming language it uses is basically a slightly-more-easily-parsable version of REALbasic that uses global functions for everything. All code is started from an event, usually either a button click or entering a card. It’s missing some nice features for more advanced game creation, especially detecting whether a key is down or not (though it can detect key press events), but it supports sprites, sound effects, and even network connections with a simple API. The documentation for the programming language can be accessed from the program’s Help menu – many people have trouble finding it.

I created a Mayan number system translator, Collatz conjecture tester, Pong clone, and P2P chat client using SilverCreator, to give you an idea of what’s possible. You can check the forums on the SilverCreator site to view more examples of games or to ask for help.


I taught 3 Bootstrap courses last year to middle-schoolers, with pretty good success. Bootstrap is an introduction to functional programming in Scheme. The students write simple callback functions to implement animation and collision detection in a 2D side-scroller video game framework.

I think it's a pretty good introduction to programming for kids of middle school age, though it assumes familiarity with elementary algebra and the Cartesian coordinate system. Others have taught it to students in the 5th grade, who had no prior algebra experience, though I can't personally vouch for how effective it is for those students.

I modified the standard Bootstrap curriculum quite a bit as I went along, removing the written workbook exercises completely (my students hated them), and replacing them with interactive programming exercises. I replaced some of the least-engaging programming exercises with some of my own creation. For example, I designed a lolcat image macro exercise for the "Introduction to images and strings" lesson. It was a huge hit: kids were making screenshots of their images and sending them to friends. I also added support for projectiles, background music, and user-defined sounds to the standard 2D game engine, in order to make the final games more compelling.

In the future, I think I'd rather use a problem- or project-based approach to teaching introductory programming, but Bootstrap is the best freely available, structured curriculum I've found so far. My main frustrations with it were the written workbooks, which I eventually dropped, as mentioned above; and the fact that I only had 10 90-minute sessions, meeting once per week, to teach it. That's barely enough class time to get through all the material, even if things go perfectly smoothly. It's definitely not enough time to give students the opportunity to explore and experiment on their own, nor especially to fail and then learn from those failures, which, in my experience, is the most effective way to grok programming. However, the compressed timeline was a limitation of the after-school program I was teaching in, not Bootstrap per se.

Find out more about Bootstrap here: http://www.bootstrapworld.org/ I'm happy to give you my modified Bootstrap framework (with projectiles, etc.) and the Keynote slides I used for my lectures. The slides have very few words; they're mostly animations, diagrams, and images intended to reinforce the oral lecture.

I also "taught" a couple of Scratch sessions to middle-schoolers. You don't really teach Scratch, though; in my case, it was more like giving a 10-minute demonstration of building a simple Scratch program, and then turning the students loose, and giving them a bit of assistance when they got stuck.

Student engagement with Scratch is typically much higher than with Bootstrap, in my opinion. My Scratch sessions were each about 2.5 hrs long, and almost all of the students kept experimenting from start until finish, with 3 or 4 even staying an extra hour afterward during their free period. However, personally, I think I'd move on pretty quickly from Scratch to something capable of procedural abstraction, if a student showed a continued interest in programming after a month or two of Scratching. Among other issues, there's simply no means for students to create their own blocks in Scratch, nor to encapsulate groups of blocks into larger blocks. However, I just heard from a friend that there's a new version of Scratch coming, code-named Sage, I think, that will provide at least some of this missing functionality.

Scratch certainly requires less effort on the instructor's part than Bootstrap. Scratch includes a ton of assets, for one thing. With Bootstrap, when your student(s) come up with a game idea, you might have to help them find images, and then do some Photoshop work to extract them from their backgrounds, scale them, etc.


Oh, one more thing I forgot to mention.

Another problem with Bootstrap is that the students seem to be quite confused about control flow. They don't understand how the whole process starts, proceeds, and then repeats itself. The confusion occurs because the students are only writing callbacks, and are never exposed to the event loop of the game engine.

Scratch does not have this problem. Scratch programmers are entirely responsible for deciding how events are sequenced (when they need to be, at least; without explicit sequencing, everything in Scratch executes in parallel by default, which is how the real world works and is therefore familiar).

I think understanding control and/or data flow is a crucial concept for introductory programming. It helps the student develop a complete mental model for how programs, when executed, create dynamic processes. For my Bootstrap classes, I came up with a pretty silly real-world scenario in an attempt to explain to them what Scheme and the game framework were doing behind the scenes, to give the students at least some sense of "who" or what was causing their functions to execute, but I'm not convinced they really understood it. There was a bit too much magic going on for my liking.


This reminds me of when I was 10 years old and got a copy of Think Pascal for the Macintosh. Previously I had done the usual AppleSoft BASIC, Logo, and even some Assembler and HyperTalk. But GUI programming stopped me short—partly due to the unattainable cost of InsideMacintosh—but mostly because the basic control flow was an inscrutable mystery to me, with nary a mention in any documentation I could find.


I learnt HTML at 10. My grandad taught me that, then I went on and used w3-schools to continue learning. I think that's a very good starting place.


I'm with dpcan on this one. I started my current 10yo on Scratch at 8 and have been giving him incremental "challenges". The immediate feedback for even his first "program" was enough to keep him hooked. He regularly keeps making new games and often pushing the system to its limits (Scratch has many annoying limitations if you're a seasoned programmer or even a kid who has figured out that something like an array - he wouldn't use that word, tho - would be useful).

He started 5th grade last week and one of his classes is a programming class which uses MicroWorlds - http://www.microworlds.com/ - as the learning platform. I grabbed the demo and may shell out the $100 for the home version, just so he can do stuff here in it as well. It's not a horrible system, but it's definitely rough around the edges.

I fully expect to have him starting in Python by 6th grade, tho.


Microsoft makes a kind of neat kid-oriented environment called Small Basic: http://msdn.microsoft.com/en-us/beginner/ff384126.aspx

Worth a shot. If you check out the blog, there are a number of tutorials available as well that can help kids get started.


http://edu.kde.org/kturtle

i created kturtle for this purpose. on most linux distros it is available as kturtle, kdeedu-kturtle or kdeedu.

kde also runs on windows: http://windows.kde.org

i learnt programming by MSX-LOGO in dutch (my mother tongue). when i got into free software i decided to create an open source LOGO-like application to enable these days kids to have a smooth start as well.

personally i dont like point-and-click programming, as i belive programming is coding and therefor needs a keyboard.

good luck!


I've done some Scratch stuff with my 10 year old (he was 8-9 at the time). It is a good starting place for teaching some of the concepts like looping, objects, and messaging. If nothing else, it is a good way to visualize those, even if you turn to something like Python for "real work".

I would start by asking him/her what she/he wants to do. Pick the tool that fits best. Want to build a game? Start with Scratch because it teaches the actor-based programming that you want to use for games.

Hard to give more advice without more specifics.


FWIW (no teaching experience here): In Russia, they're using Pascal to teach programming although I would try to explain programming in some basic abstract concepts.

Like: Program is a list of instructions for computer to do and variable is a "box" where some value is contained.

To make it more engaging you probably need to homebrew some nice and easy to understand demos. Random idea: write a simple graphical library for visualisation for your favourite language to use with your demos.


Do some web stuff with basic HTML/JavaScript/PHP or Flex. Having a command line program that adds two inputed numbers is great and all, but having two input boxes and a submit button followed by showing the answer to the side is much more entertaining. (If you go the JavaScript route I'd recommend something like ExtCore as a library instead of raw 'ajax' and so on.)


Read Seymour Paperts book Mindstorms

http://www.amazon.com/Mindstorms-Children-Computers-Powerful...

The main point is to have children do something they understand from the real world and have a physical relationship with. That way it won't feel as abstract.


Probably not a popular opinion, but I found BASIC a nice way to learn about programming when I was around 10. Especially line numbering and goto's seemed intuitive and although I wrote lots of spaghetti-code, I'm glad I learned using a model that somewhat resembled how machines actually execute code.


Check out Kojo (a tool that I have been developing and teaching with for the past few months):

http://www.kogics.net/sf:kojo

Kojo includes:

- Logo like stuff to begin with

- Processing like stuff for the next level

- A Virtual Math Lab


For an introduction to programming and Ruby at the same time, Chris Pine's Learn to Program ( http://pine.fm/LearnToProgram/ ) is excellent.


I'm currently using this to learn programming and couldn't agree more.


I think Perl is better way to teach Data Structures.

http://developers.slashdot.org/comments.pl?sid=174164&ci...


Have you tried App Inventor for Android? Really easy to get started with and you get an actual application that can be used on a phone. Very encouraging and inspirational.



Put a LAMP stack together for him and have him create basic website stuff that he sees everyday.


C++ and then Java. It's what I did, those two will introduce him to OOP, and making GUI apps in Java is never going to get old, I guarantee.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: