Teaching Programming Skills to Children?
KlaatuVN asks: "My younger siblings are asking for ways to learn to program. If I remember correctly, when I was younger I started programming by writing games like 'Lemonade Stand' in BASIC for the Commodore 64. Short of finding a Commodore 64 emulator and digging up some old BASIC programming books somewhere, what do you think is a good way of teaching children to program? I'm not trying to start a 'language war', but that does enter into it. Should I start with a scripting language? What, O Wise Slashdot Readers, are your opinions?" When I was just starting out in computers, I remember LOGO being a big help in teaching me the logic skills I would eventually use as a programmer. I know LOGO is still around, but it would be interesting to note if there are other similar projects like it. What tools, and programs would you use to teach programming skills to interested youngsters?
I've been teaching Python to older kids and teens (10+) and have had good success. A few younger kids started in the classes but had trouble with typing and general computer skills. Most of the kids caught on to programming and were writing their own variations on assignments.
Very young kids have problems with attention span, reading, typing, etc. so you may want to use something like Lego Mindstorms instead of text-based programming.
See www.geekschool.org for one approach.
Lego Mindstorms and it's RCX language. Fairly intuitive, robust, and you can get it to do cool real-world stuff.
While I think a child might be ok with making some little PC games, I think they would love it even more if they could build a dinosaur and make it walk like they want it to.
Looking for hardware (Currently need: Large Etch-a-Sketch) Have one? See my journal!
I would vote for assembly (no this isn't a joke). Assembly is really simple when it comes down to it and would be good for instruction for several reasons:
1) fewer operators than pretty much any other language (unless you're talking about x86 asm)
2) teaches how computers *really* work inside. I never became an effective C programmer until I learned assembly and what was going on behind the scenes. Your kids will learn the basics of booleans, memory layout, branches, etc much more thoroughly than if they started with C. After they've mastered asm then they can move on to C and will appreciate it that much more.
No, I'm sure they get enough of a brainfuck in school.
Teacher: "You are all individuals"
Students: "Yes, we are all individuals"
"Can of worms? The can is open... the worms are everywhere."
I'd look at it from some criteria. The weights that you give these criteria would vary depending on your target audience. For most audiences, I've listed them in descending order.
I refer to the Lego Mindstorm's RCX here. There are two forms for this. One is the graphical program builder that comes with it. The other is traditional languages like NQC. Generally, NQC etc have all the disadvantages of C.
Overall, either Logo or Python would be a good choice, depending on your target audience. I'd say that Logo would be a good choice for 12 and under, and that Python would be good for after that. Note that Logo knowledge easily translates to Lisp, so one possible track would be to start with Logo, and later transitition to Lisp.
Karel takes simple commands (for example, turnLeft(), moveForward(), or pickUpBall()) and has boolean functions that act as sensers (such as hitWall() or wallOnRight().
When coupled with basic control structures, it's a fun and easy language to learn, and most Karel implementations have a graphic display of Karel moving around its world, so a wall-hugging function like the following isn't purely academic, it can be experienced just by watching.
You can make Karel programs that solve mazes or that clear the room of balls, etc. It's obviously not a good programming language to do anything of use (although I have seen a Karel half-adder accomplished by picking up and dropping balls), it's a great introduction to OO programming that seems more like a game than education.Sit them down on the couch, push the DVD of Hackers into your player, pour the microwave popcorn into a big bowl and have them enjoy the movie for 90 minutes. Then when the show is over, carefully explain to them that real-life programming is the exact opposite of everything they just saw.
Hope that helps,
GMD
watch this
Though I don't have children I would think that something like Robocode would be ideal. Considering that you can get almost instant feedback for the changes you make, and that it's a game, which if my niece is any indication, will consume any child above 2.5yrs to the point of tears when bedtime comes around.
- Gef
...or Visual Basic. Seriously.
I have to say this, because someone recommended assembly language with a straight face.
Some things you should remember:
1) Programming languages are just an expression of a problem's solution. The less time you can spend learning to express, the more time you can be solving.
2) Teaching someone logic is really the goal at early stages. Teaching them how a computer works (i.e. - low level programming) is really just noise at the start. Teaching someone object orientation is problematic in the opposite direction.
3) Your mileage may vary by age. A ten year old learns VERY differently than an 11 year old.
4) You're probably a genious that learned to program by plowing through manuals and books and scouring the web. This makes you the exception to the rule. Most people do NOT learn this way.
5) Not everyone will be good at programming, ever, but everyone can make it further than Hello World...they can make it to the point where they are conscious that they are _creating_ something.
6) Most people benefit from immediate visual feedback. Teaching someone how to compile and link slows them down. Teaching someone to write to stdout slows them down. Slapping together something in Visual Basic and then showing them how to hook up responses gets them moving quickly, especially when they can hit F5 and see what happens immediately. VB adds other complexity, though, which makes something like LOGO better in terms of simplicity.
7) Not everyone wants to be a coding god. Some people just want to see what programming is, some people _think_ they are l33t hax0rs but don't know shit (you always get these in large classes), some people are there against their will (parents made them do it, etc)...just keep it simple and fun. Most people won't take this to be the start of a career in software development.
I used to teach programming courses for summer camps. Java is just totally inaccessible as a first language. I tried. Visual Basic actually worked very well. Object orientation is best explained by NOT explaining it (people will naturally understand what a "push button" is, but it's a waste of time to explain how it's "subclassed" from a "widget". These things can come later). Half the trick is not scaring them off in the first few weeks.
If there was a free Logo package that didn't suck, I'd have used that (maybe there is, I couldn't find one at the time, but that was years ago).
My response to it all was to develop Toby (http://icculus.org/toby/), which is a variation on Logo.
--ryan.
Don't say, "don't quote me," because if no one quotes you, you probably haven't said a thing worth saying.