Ask HN: Teaching programming to a 10 year old, and I'm kind of lost
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.
(
50 comments
| 42 points
| on HN
)
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.
http://en.wikipedia.org/wiki/Not_Quite_C
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
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.
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.
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.
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.
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).
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.
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
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à.
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.
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...
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 :-)
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 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.
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.
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.
Worth a shot. If you check out the blog, there are a number of tutorials available as well that can help kids get started.
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 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.
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.
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.
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
http://developers.slashdot.org/comments.pl?sid=174164&ci...