Fog Creek Software
Discussion Board




Teaching Programming

I have two sons, aged 12 and 17. They want to learn programming.

I would like to get your advice on how should I help them start learning. Which language would you recommend? And on which topic? They both are very interested in music, maybe we can start with some related with music.

Aydin Sakar
Monday, January 06, 2003

Your 12 year old could have some fun with Toontalk: www.toontalk.com

Toontalk looks like a game, but it's actually a full-fledged visual programming environment.  Don't reject it until you've dug down a little bit and seen what it can do.  I used it to teach programming concepts to 5th and 6th graders several years ago with good success (much better than several Logo systems I tried first). 

If you've got a bright 12 year old you should be able to just set him down with the introductory puzzle sequence.  No need for him to look at a manual or anything.  He'll play with it and work his way through the approximately 70 "puzzles".  At the end of it he'll be a pretty good programmer without even realizing all the work he's done.  Music (in form of wave files or maybe mp3s) can be integrated once he's writing "free form" programs on his own.

Herbert Sitz
Monday, January 06, 2003

If they have strong orientation towards math, I'd start with a relatively simple low level language (the only real choices these days are C and Scheme; Perhaps Delphi as well) and let them build up from there.

Otherwise, Python is a great choice, and you can find very good material suitable for kids at [ http://www.livewires.org.uk/python/ ]. It assumes no prior knowledge, puts emphasis on hands-on experience and ends in a simple robot game (I remember an asteriods game as well, but I can't find it now - might be my imagination). Even if you don't use the LiveWires material, Python is a better language than most to start with.

Under no circumstances start with a language that enforces an OO point of view (e.g. Java), and try to make them write procedure code before they go overboard with OO. OO is highly overrated, and it's way too easy to get carried away with it. It does have its uses, but for 90% of today's projects, procedural code gets the job done simpler and more reliably.

IMHO, Music is a rather complex subject to start with, as both input and output require much consideration and knowledge, and might be frustrating. Graphics (and games) provide much faster and simpler feedback, and are a better introduction to programming. Your mileage may vary.

Ori Berger
Monday, January 06, 2003

Turing is an old teaching standby ...

Chad R. Millen
Monday, January 06, 2003

My $0.02 ... I've found that, the younger kids are, the more important it is for them to have some sort of immediate visual feedback. If you give them stuff about pointers, algorithms, type declarations and the like, their eyes will probably glaze over.

I know this is gonna make some people's eyes roll back, but I would recommend (HTML and) JavaScript. Here's why:

* It's free. If you have a web browser, you've already got JavaScript.

* Nothing to download. All you need is a text editor, like Notepad, and a browser, like Internet Explorer or Netscape. In other words, you don't have to pay one cent or download a bunch of programs.

* It's well-documented and widely-used. There are several great books and websites dedicated to not only discussing JavaScript, but teaching it as well. They can rely on tutorials like HTMLGoodies http://www.htmlgoodies.com/primers/jsp/ when you're not around.

* It's very forgiving. You don't need to worry about declaring variables, strict typing, NULL pointers and the like.

* It's very simple to get started. No compiler is needed. To have them do their first "Hello, World" program will take 30 seconds.

* Others' JavaScript work is visible. If they want to see how someone else did JS or HTML, they just need to View > Source.

* And last, but not least, it will let them create their own webpage and share it with others.

I'm not saying JavaScript is perfect. And I'm not saying it should be the foundation of a career in programming. But for teaching kids, so they enjoy the experience and learn a lot, I think it's great.

Joe

Joe Grossberg
Monday, January 06, 2003

Had to laugh as I recalled my first programming experience.  I believe I was in first or second grade and was typing in a basic program on the TI 99/4A, it was a number guessing game from the manual.  I recall the teacher was upset with me because I wanted to finish typing it in to see what it would do.  She proceeded to tell me to go outside for recess instead of spending my time on that "silly" computer.

Anyway, did'nt mean to de-rail the thread.

If/When I have children of my own, and they happen to be inclined to want to learn to program, I will supply them with a BASIC (not VB) interpretor.  It's how I learned.  Type in a program (or even just simple statements FOR NEXT, IF THEN), watch it execute, play with it.  Learning to program is not a structured process, it's a matter of digging in and experimenting,  with a little guidance along the way.  I remember typing in a FOR NEXT loop on that TI and watching it count from 1 to 32k (or 65k can't recall) and wondering why it did'nt go past it.  As for having to have visually stimulating material... well that's just plain outrageous.  Why do you have to entertain kids so darn much.  If a kid can't be fascinated by a FOR NEXT loop and has to see some idiot cartoon on screen then programming may not be for him.  Either that or society has kids programmed to have to be entertained.  Getting the program typed in right, having it execute and observing it should be enough.

Anyway... just my 2 cents.

Dave B.
Monday, January 06, 2003

I agree that kids need a lot of instant feedback.  As a result, I would recommend against a commercial-style progrmaming environment.

I, too, got starting programming by learning BASIC, and I recommend that you look into setting up a simple command-line driven environment with a BASIC interpreter so the kids can easily start banging away at programs and extend them.  The point is to make it *easy* for them to write and extend programs, much easier than it is for us old-timers who aren't confused by compile-time type checking and debuggers.

I also recommend Visual Basic, as it provides lots of instant feedback with a feature-rich programming language behind it.  Sure, the kids aren't necessarily learning "real" programming, but the point is to get them familiar with programming.

Once they're excited about coding and have developed a bunch of little projects, move on to the basics of real programming:  compilers, common high-level languages (C++, Java, etc.), debugging, etc.  Their early "playing" will give them the enthusiasm to learn the new tools.

Brent P. Newhall
Monday, January 06, 2003

The need of younger kids to have instant feedback and to have fun while programming is exactly why I recommend Toontalk.  I tell you, it works!

If it doesn't look serious enough for you upon first look, read this description of the "computer science behind Toontalk":

http://www.toontalk.com/English/computer.htm

Toontalk can translate its visual programs into Java programs that can be run over the web.

Especially impressive is the way programming constructs have exact metaphors within the Toontalk world.  For example, kids "train" robots to perform actions in Toontalk.  These robots correspond exactly to program methods.  Kids use scales and can put things on different sides of scales (or have robots do it form them) to do comparisons; these scales correspond exactly to comparison operators.    Kids can pick up a number or letter (or string of letters) in Toontalk; these correspond to constants.  Boxes with holes in them where kids can place numbers or letters correspond to variables in a textual programming language.  It's mind-blowing how neat this thing is.

Toontalk is not just a game (or even a game at all, even though it has similarities to some games).  There's a tutorial included with Toontalk that goes through the steps of using Toontalk to program the game, "Pong."  Kids are limited only by their imagination in what they can do (or at least they may feel that way).

Herbert Sitz
Monday, January 06, 2003

Two Words: Lego Mindstorms.

--

Piaget pointed out that children pass through various conceptual development stages and that children at a given level can not understand concepts at a level above them.

I believe it would be a mistake to teach C to anyone other than a very bright 14 to 16 year old. Perhaps a 12 year old at a genius level but only if they requested it.

The whole pointer thing and the whole unsafe language issue I suspect would be too much for most children and turn them away from programming in frustration. Assembly would be better than C! (And if assembly, preferably on an AIM-65 or such!) Likewise, I think object oriented programming is too much for a child of that age and trying to teach it would be counterproductive. Things must be introduced at the right time and not before.

Music programming is very hard. I know this. If they are interested in music get them a sequencer and a synthesizer! Let the m compose music. Sequencers nowadays like Logic and Cubase require programming skills to use advanced features and the entire exercise of composition is one that will make them into far better programmers that programming can. This is why the among the best designers are so many programmers. The key is that both are exercises in architectonics (the creation of systems) and compostion is far more rewarding than programming for someone who is interested in music.

Finally, you absolutely must not impose programming on them if they are not interested. A lack of interest is a very important cue. Programming may not be int their nature, or they may not be ready for it. Either way, you do more harm that good to impose it.

One thing I would recommend is to set them up with a DOS machine and teach rudimentary BASIC. Show them how to write a program:

10 PRINT "WHAT IS YOUR NAME";
20 INPUT NAME$
30 PRINT NAME$ + " IS A BIG DUMMY!"
40 END

If this they find amusing, they will learn to program in BASIC on their own. The old guess the number game is a good next step. This is how I taught Pacific Islanders to program when I taught school in Micronesia. If you do not have any video game consoles, or internet connections in their bedroom, it is more likely they will find time to learn and compete with one another. Write them a simple text adventure and lend them your parser so they can write their own. That is great fun.

Let me repeat -- Let them set the pace and do not force it upon them!  And if they aren't interested, teach something else.

And get them a sequencer and keyboard regardless.

X. J. Scott
Monday, January 06, 2003

Dave B. said, "As for having to have visually stimulating material... well that's just plain outrageous.  Why do you have to entertain kids so darn much?"

All I can say is, there weren't many kids like you back when you were a kid, and there are even fewer now.  I trained myself at age 14 programming the TRS80's Level II Basic and even a bit of Z80 assembly language.  There may be 14 year olds still around who would still get excited by that.  But I don't think there are very many.

Also, the attention span of the average kid for this stuff is closely age-related.  Most 11 and 12 year old kids are going to have an attention span of about 60 seconds if you try to start teach them text-only methods of programming.  Text only methods may work with older kids.  But even then they're going to have to have some goal in mind so they're not going to get bored.  If the goal is to build a real mini-application, may as well have them using tools that take the drudgery of that away: use visual basic, delphi, or python card.

Herbert Sitz
Monday, January 06, 2003

in my experience, there is a direct correlation between someone being a good programmer, and someone who spent a lot of time typing in basic code listings when they were 12. my new crackpot theory is that programming has very little to do with abstract reasoning, and a lot to do with muscle memory. ;-)

schemer
Monday, January 06, 2003

10 print "Bella"
20 goto 10

Or to get real fancy

10 print "Bella ";
20 goto 10

Bella
Monday, January 06, 2003

Ha, I remember typing in all those code passages from Compute! magazine.  When Computes! Gazette came out, I subscribed immediately

http://216.239.33.100/search?q=cache:6b3i6R2UoDMC:value.net/~earth1/gazette.htm+%22Computes!+Gazette%22&hl=en&ie=UTF-8

Bella
Monday, January 06, 2003

more support from my hypothesis: (I'm one of the basic listing typer guys)

I can still program better than people who "don't get it" even when I've been up for 2 days, or am totally drunk. Of course, not as well as when I'm straight, but if it wasn't muscle memory, I shouldn't be able to even code at all...

schemer
Monday, January 06, 2003

Schemer,

You are so right about muscle memory! It's been years since I programmed in basic and yet I typed that dang semicolon at the end of the print statement to repress the newline.

I did not even remember anything at all about that but my fingers did!!!

Whoa, like I am totally blown away right now....

X. J. Scott
Monday, January 06, 2003

My kids emphatictically don't want to learn programming at least not right now and certainly not from me.

Nonetheless, having them do web sites about the music they like, or a fan site for their favorite band might be a good motivator.  A host with PHP and MySQL are easy to come by.

tk
Tuesday, January 07, 2003

http://www.ariel.com.au/jokes/The_Evolution_of_a_Programmer.html

You must see this, if you haven't, before you teach you children. :)

S.C.
Tuesday, January 07, 2003

an old version of asymetrix toolbook 1.5 or 3.0 would also serve nicely.

Puthon is positioning to replace pascal as language of choice for academic use
'
Turbo pascal 5.5 can be had for free at borland museam

I was thinking of doing an intro book using javascript -standalone NOT in browser...

Karel
Tuesday, January 07, 2003

Python is the easiest and "most fun" language around at the moment, i think. lots of inertia in the dorkball crowd, too. So your sons can meet a lot of cool slashdot-caliber friends!

If I was a dad, I'd probably forbid my kids from programming. 12 and 17 sounds too young to begin developing severe back, carpal tunnel, and personality problems.  I'm actually kind of miffed that my programming uncles didn't warn me about what I was getting myself info. If I ever have kids , it is going to be golfing only...at least they'll develop a useful, and potentially lucrative skill. ;-)

schemer
Tuesday, January 07, 2003

My first programming experience was a quick 4x1 hour intro to Pascal, given by a high school teacher in his spare time. We had no computers, and all was done on paper. I was 14 at the time and loved every minute of it. From there I continued on an HP41c programmable calculator. Great fun!
Pretty soon I had talked my brother into getting a TI 99/4A. This had a screen and I delved into games programming, because this was the stuff you could get the other kids on my street excited about. The net did not exist at the time in our small village, so peer feedback had to come from your immediate physical surroundings.

I do think this social feedback is the most important thing. If they are in to it your kids will find their scene, and the skills will come pretty quickly. This will often be game-mods, graphics demos, hacking ... Their programming tools will most likely pretty much straight away become C, PHP and the like. Don't worry. These might not be sound choices, but remember this is not what it is about for them. If you like to steer them to more sensible stuff, find them a more sensible scene. With them hitting and living through full puberty, you might not have the influence you would like though.

Just me (Sir to you)
Tuesday, January 07, 2003

Give 'em Godel Escher Bach or something.  The thing I don't quite understand is /why/ they want to program.  Is there anything specific they want to automate?  Do they want to put pretty pictures to screen, write utils, make games?  Would they like to take a game (like something from Sid Meier) and automate away all the boring repetitive things?

Unfortunately, most games aren't developed so you could do this... hopefully there will be clones which do one day.

anon
Tuesday, January 07, 2003

An interesting site about learning about programming with delphi is http://www.delphiforfun.org

Bert
Tuesday, January 07, 2003

I remember getting a Sinclair ZX81 for xmas and writing a BASIC program that exceeded its 1K RAM that same night :)

I think the suggestion about learning HTML is a good one. Buy the kids a domain name and some cheap hosting and let them make a web page.

Andrew Reid
Tuesday, January 07, 2003

Please remember what it was like being a child/teen, especially that your parents knew nothing about any subject you were interested in.  (Even if they did, you refused to listen.)  Don't force anything on them, even if you do it 'gently' and mean well.
Give them support, and if financially possible, buy them the tools they need - books, etc.
Remember that children/teenagers are not stupid, and if they don't understand something, its very rarely because they have a low intellect, it's because it's being taught badly.

ScottB
Wednesday, January 08, 2003

Amen, ScottB!  Well said.

I was surprised to discover that my local, small library has a lot of up-to-date computer books (covering everything from XML to VB.net).  So, a trip to the library for some introductory programming books might be fruitful; it's free.

Brent P. Newhall
Thursday, January 09, 2003

D-Robots!  http://www.plasmacode.com 

I ran across this game/program on a Delphi newsgroup yesterday, and it just struck me that this could be good fun for a kid learning how to program.

D-Robots is kind of like a cross between a Quake-First-Person-Shooter-Type-Game and the remote control robot battles you see on tv. 

It's like Quake because everything happens in a Quake-like virtual battle-world. 

It's like the remote-control robots because you control how your robots fight in battle.  You don't control them with remote-control, though.  You control them by writing a program to determine what they do and how they react to things in the virtual world.  The program-scripting is in a Delphi script language integrated into the program. 

There's not much documentation on how the thing works, so if you're using it to teach kids programming you'd have to give them some lessons.  The scripts for the example robots would be very helpful.  Looks to me like it would be good fun.  (And not just for the kids.  I don't think the primary users of this program are kids.)

It could be a fun family competition.  You could all program robots and then have them battle each other.  If one of your sons' robots seems to be doing silly things in battle, you could tutor him through figuring out what could be improved in the code controlling the robot. 

Seems to me like this would be an excellent way to learn some programming.  And the D-Robots environment seems like it might be one that could really motivate a kid to do some good work.  Might not work great for everyone, but looks worth a shot.  (I would also second the Lego Mindstorms suggestion that somebody made a while ago.)

Herbert Sitz
Thursday, January 09, 2003

I put an extra space into the link above that was causing some problems.

Try http://www.plasmacode.com

Herbert Sitz
Thursday, January 09, 2003

Heh, I started with ARexx, went over to AmigaE and from there I jumprf into assembler. Clearly not for everyone, but if someone really, REALLY wants to learn programming he or she should try assembler fairly early to get a solid foundation. If you haven't done any assembler programming you've missed out as far as I'm concerned.

As a first language, try Pascal or maybe even REBOL. The latter might be a bit unorthodox, but it is rather easy and it is _very_ good if you're after visual feedback (REBOL/View that is).

Lennart Fridén
Friday, January 10, 2003

*  Recent Topics

*  Fog Creek Home