What's the best way to teach 6-9 year old kids to program?


It is practically impossible to teach good programming style to students that have had prior exposure to BASIC
 Teach 'em python, and they'll never write a badly-indented piece of code again :)
I think there are plenty of good coders in this community that started with BASIC.. There wasn't much choice when I was 5-6 years old..
 That is a classic Edsger Dijkstra-quote, from his little musing "How do we tell truths that might hurt?". Full memo here: http://www.cs.virginia.edu/~evans/cs655/readings/ewd498.html

Dijkstra is, by all accounts, part of the pantheon of computer science. However, I would trust him more with finding a funny putdown of a computer language than with actual advice on computer languages to use. Although he was right at times:

The use of COBOL cripples the mind; its teaching should, therefore, be regarded as a criminal offence.
:D
 
I would start with Apple Script. Yes it only works on Apple computers but its so high level that anyone can learn it. Also scratch (which runs kn the Pandora)
 
Oh, and a question I missed the first time around: I'd definitely do development on a "big" computer at first. There are sizeable advantages to a fullsize keyboard and generous screen real estate when coding (or doing most anything similar, really). _wb_ might be able to write complete games on the pandora, but I would hazard a guess that he is a lot better at keeping state in the head and planning stuff out than the average complete beginner :)

For several of these languages mentioned above, there exists interpreters or similar on the pandora, too, so it will be a cinch to code something on the big box, transfer it to the pandora and see it run there, too.
When learning to code, you'll typically start with small toy examples, and there will be no need to type fast - in fact, even if you're a very advanced coder, if you need to type fast for coding, you're doing it wrong.

So why not learn to code on the Pandora? I had my first experiences with coding on the Commodore 64, which could display 40x25 characters. On my Pandora I set the font so that I get 99x28 characters.

I'd recommend Python, C or Haskell as first language by the way, depending on how strong you like your typing.
 
I'd recommend Python, C or Haskell as first language by the way, depending on how strong you like your typing.
Haskell ? Really ? you really need strong mathematic mindset to "think" in Haskell, I find. It's probably not very natural for beginner (especially very young folks). 

C is a simple language but it takes a lot of lines to do stuff, and you need to compile programs before running anything - I like Python in the sense that you can really toy with it and simply run and iterate quickly.
 
Whoa!  Thank you for all the sugestions!  Now I don't know what to do.   :)
As EssoAir and I said, I'd expose them to something simple and fun like those lego-ish "program bricks" softwares that are Scratch, Stencyl, or any other klik & play-like.


It teaches basic logic and some (like Stencyl) allow to mess with real code when what you want to make is more complex than what's available in the building "bricks".


IMHO It's hard to find something funnier (for children and adults) than making you own games in a few clicks and messing with the logic behind it. (I personally spend quite some time just messing with friction and gravity in a "platform game" :p )


Concerning a "real" coding language, you'll have as many opinion as there are devs here, I'd say no matter the language! You just need something that allow your kids to learn the programming logic, that way they'll be able to learn any programming language pretty fast (since the underlying logic is more or less always the same).
 
Last edited by a moderator:
I'd recommend Python, C or Haskell as first language by the way, depending on how strong you like your typing.
Haskell ? Really ? you really need strong mathematic mindset to "think" in Haskell, I find. It's probably not very natural for beginner (especially very young folks). 

C is a simple language but it takes a lot of lines to do stuff, and you need to compile programs before running anything - I like Python in the sense that you can really toy with it and simply run and iterate quickly.
What feels natural depends mostly on what you're used to. If you're used to imperative languages, they will feel natural. Functional and logic programming languages are strange and difficult for people who are used to imperative programming, but to someone who has not done any coding at all, they sometimes make more sense. E.g. you can write


x=3;
x=5;
in imperative languages (destructive assignment), which is kind of weird in a way - x being equal to 3 first and then 5, can't x make up its mind?

If you use libraries, you don't necessarily need lots of lines of code to do stuff in C. I don't think the difference between compile&run and edit&interpret is that big - in both cases, it's easy enough to write a simple shell script that does what is needed to run the program - or you can use an IDE.

Anyway, I agree that Python is probably the best choice.
 
What feels natural depends mostly on what you're used to. If you're used to imperative languages, they will feel natural.
Sure, but it seems to me that imperative languages are closer to natural languages and therefore closer to how we are expected to express ourselves. That's why Python and Ruby are so popular - they are easy to read and to grasp. Functional languages are not straightforward to understand when you read their code for the first time, and if you were to explain to someone who had never seen code some Haskell piece, they may me more confused than if you explained something in Python. Just my guess.  
 
Oh, and a question I missed the first time around: I'd definitely do development on a "big" computer at first. There are sizeable advantages to a fullsize keyboard and generous screen real estate when coding (or doing most anything similar, really). _wb_ might be able to write complete games on the pandora, but I would hazard a guess that he is a lot better at keeping state in the head and planning stuff out than the average complete beginner :)

For several of these languages mentioned above, there exists interpreters or similar on the pandora, too, so it will be a cinch to code something on the big box, transfer it to the pandora and see it run there, too.
When learning to code, you'll typically start with small toy examples, and there will be no need to type fast - in fact, even if you're a very advanced coder, if you need to type fast for coding, you're doing it wrong.

So why not learn to code on the Pandora? I had my first experiences with coding on the Commodore 64, which could display 40x25 characters. On my Pandora I set the font so that I get 99x28 characters.

I'd recommend Python, C or Haskell as first language by the way, depending on how strong you like your typing.
I would rather have something lisp-ish than haskell, but apart from that I'm with you :)

The reason I'd go for a big keyboard for a beginner isn't for typing speed, but for ease of access to special characters and ease of helping out - A lot of the special characters needed when programming stand out better on a bigger keycap, and if I as a parent sit beside and try to help out, it works better to point at a key when my index finger doesn't obscure half of the keyboard :)

The bigger screen is similarly for overview: The more of the code you can keep visible onscreen at one time, the easier it is to handle cross references of different kinds (function calls, variable declarations, and so on). Also, if you do something in the graphical vein (i.e. scratch), the number of pixels in the vertical direction really does limit you...

I started off on an ABC80, and after that a ZX Spectrum. Then again, I wasn't being distracted by Youtube :)
 
Last edited by a moderator:
I'd be interested to see how easy it is for beginners to pick up on a functional language (and Haskell is the best example of those imo) before being conditioned to think imperatively and procedurally. I'd like to know how much that is conditioning by learning other languages first and how much it's just the way things are. And functional skills are useful in Python and Java too, as it's a growth area in other languages at the moment.


But I'd vote for Python to start with. I learned it from Guido's python tutorial (first few chapters of the user manual), and it taught me the fundamentals really well. And I've used Python a lot in the jobs I've had too - it's a really powerful language as well as being easy to get to grips with.


Still, nothing can beat the immediate feedback I got back in the day from coding BASIC with graphical commands back on the 8-bits. ZXDunny's BASIC port looks like it could be good at replicating that, but in all other respects I consider BASIC a bad place to start. Maybe libraries like pyGame could replicate the old experience, but I've not used it myself, so I don't know.
 
For older kids I'd say Python and Pygame. But at 9, any text-based language might be frustrating. I've worked with 10-year-olds doing HTML, and there was a lot of difficulty seeing where what they'd typed was different from what they were trying to copy.
 
Not used it myself, but like Scratch, I think KODU is a nice one for your kids as a starter, due to the very visual style and building-block use of it.

I'd imagine you'd get a result pretty quick, and likely to hold their interest. Then as they gain more interest they can pick up the more textual code based ones...

http://www.kodugamelab.com

It looks like this;

kodu-1.jpg
 
I wrote my first BASIC game when I was 6 or 7. It was a crap game to be fair, and of course every kid is different. Perhaps Python should be the advanced version, but what is there for 'standard' kids? Lego mindstorms?


Edit: KODU looks promising too, to be fair.
 
Last edited by a moderator:
I started programming by typing many lines of basic, 90% of which I had no clue about, to make little Pong games from the instruction manual of magazine. I think it was quite a while after that I started to think about what it was I was actually inputting. I'm not sure I'd recommend this approach, although I reckon it might have given me some amount of determination (many times I input programs that didn't work, I didn't know why, so I just started again from scratch until it did work).

Edit: I remember at the time I didn't even know the names for characters like ; (semi-colon in English) so made up my own names for them... 
 
Last edited by a moderator:
take a look how easily can You 'code' a game in Click And Play. 

http://www.youtube.com/watch?v=LUTpumYboDs

Its more intuitive than kodu
 
Last edited by a moderator:
Back
Top