While I'm not ready to indoctrinate my four-year-old into the monkhood of true geekery while he's getting in his prime running around time, I was curious to see how logically he could think. My layman's knowledge was that children began properly interpreting and creating rules around the age of six, while four was still wild imagination territory.
For my experiment, I created an extremely minimal programming game, like a very stripped-down version of RoboRally:
The image depicted is doctored. We had already completed four playthroughs the night before with a similar setup, however. He was able to figure out how to program the robot to collect all of its pieces (three Duplo blocks comprised the robot; successful completion of the robot wins the game). I demonstrated the rules once, and then let him try to play by himself with minimal guidance. One interesting strategy he discovered was placing the "instructions" (the cards with arrows) on the game board in order to create a path.
A few weeks later, we played it again, and I taught him how to make new "instruction cards". We're not yet at the place where we've done anything with variables and abstraction.
Apparently he liked the game well enough, because he independently recreated it at school:
1. result = ask_parent_or_candy(mom, nicely)
2. if result != candy:
3. ask_parent_for_candy(dad, nicely)
If i had a child, i would start her out on python, because python is essentially in english, and english is the only code i'd prefer to write, given the choice if there were a formalized english scripting language.
Even in python there is a bit of jargon that i think is an unfortunate holdover. Int vs float may be necessary, but "string" is a poor term for what is essentially text. I'm not saying we should change anything, because coding is becoming more like natural language organically, but again, if i were to teach my child coding (and i don't want to step on any cuteness of this story), i think a child would understand python better than anything with brackets and semicolons.
Full disclosure: i genuinely like python better than most languages.
"There will always be things we wish to say in our programs that in all known languages can only be said poorly. " -- Alan Perlis
enderton page 107, 289, etc: http://books.google.com/books?id=dVncCl_EtUkC&printsec=front...
But the crazy thing is that I didn't plan the whole thing. It was more of a "lets build an app together" type of thing. My kids and I have been talking for a while about building an iPhone game together so that's where the whole iOS thing came from.
But you raised a good point. If you had a choice, what would be the best language to start off kids with? And maybe you're right, maybe there should be a new language built just for this purpose.
Maybe a bunch of us coding dads can create an open-source mini-lang of some sort with the sole purpose of teaching kids to code.
How many lines of code would it take to draw a line and circle in objective C? How many of those lines would be indecipherable boilerplate?
I also like that it can be completely open-ended what kids do, like crayons and paper instead of the awful stuff they have to do in computer labs at school. (play stupid games that drill the facts you'll need on the standardized test; win virtual money you can spend on accessories for your avatar; vomit) See Seymour Papert for similar rants.
All that to say, a slight modernization of UCBLogo would be a fantastic project.
3. front_door.paint(3, :red)
I'm no psychologist, just a parent of two curious kids. I think a lot of things come together at around the age when kids are reading, and beginning to write.
Another question I'd think about is: When is a child too old? Those years around 6 to 12 (give or take) are a beautiful time because kids are curious and active, but they haven't yet fully internalized all of gender roles and rules about who can be interested in what. Also, they are still at least a few years away from that terrible age when things like GPA and job skills matter, so they are free to explore interesting subjects for fun and not according to any particular set of rules.
(For many months, I had no idea there is such a thing as "else", so I used to end the body of "if" statements with a "goto" to jump over the next few statements to emulate the effect of an else clause.)
In addition to basic I/O and animations, it's able to deal with a lot of the device capabilities, including SMS, GPS, dealing with the camera, and so forth.
Unfortunately, I don't know of any similar environment for programming iThings --- Apple fairly famously rejected a Scratch port from the app store in 2010:
although a "Scratch player" for Android is in alpha, and apparently, people are also working on pure HTML versions.
learn.code.org has quite a few interesting facets, including using Angry Birds and Plants vs. Zombies artwork; they also integrate light-bot as one of the avenues for learning.
What comes to mind is, we need a list of analogies in the most simplest form so that we can explain fundamentals like variables to kids. Hell, anyone who doesn't know how to code really!
75. HN reads and smiles
Kids get stuff like this really fast.
I'm re-learning basic trig right now for drawing OpenGL stuff, and I was trying to think what I could have told younger-me on why I should be paying attention in high school for this topic.
When I was in high school, it would have made me more attentive if people said, "Hey, this stuff that finds circle arcs and radius, you can use this in real life if you decide to get into gaming, graphics, .. (and other cool topics that would excite me)."
It's about how I decided to pursue coding as a career when I was in high-school.
I think the main thing is to tell younger kids that coding is an art just like drawing and that there is no right or wrong way of doing stuff. They should not be afraid to break things and experiment and they should absolutely have fun building things, seeing things come to life. That's what got me into coding in the first place and I think that's what makes a world of difference. The rest, the variables and things like that are secondary.
10 PRINT "HELLO"
20 GOTO 10
That's 3 or 4 steps. No IDE, no GUI, no variables. A program I could re-create completely on my own the next day.
Today, there is all this cruft they have to be shown (Cmd-R, XCode, etc.). If they screw up they can't just reboot.
There are benefits of course. Knocking out the power cord doesn't destroy the work in progress. There are non-volatile media. Screens have colors :-)
I just use a terminal and "bc". He loves to type in numbers and + or * and see the result. And for + we "guess" ahead of time what the result will be.
What amazed me early on: bc has variables. I explained it to him and somehow he immediately got it. You say A is 5 and B is 1 then A + B is 6.
His attention span is usually around 5 minutes, but each time it's fun.
I was so pleasantly surprised when she got the whole variables thing. I think drawing analogies to real life stuff is a sure way to get kids engaged, especially if the props you use are toys. About the attention span - yeah I noticed my 5 (almost) year old wanted to try when he saw his sister having fun, but then he got bored after a couple of minutes.
For whatever reason, this irks me when reading as a grammar error. It's like a klaxxon sounding in the middle of the sentence.
So kids 'playing with their legos' is valid given the fact that LEGO has become a household name and LEGO can refer to the brand, the game itself, while Legos, or legos can refer to the LEGO blocks themselves. It's sort of like using Google as a verb (http://en.wikipedia.org/wiki/Google_(verb))
Thanks for reading btw
PS. English is my third language so a grammatical error here and there wouldn't be that bad anyways :)
This was an interesting discussion if you're genuinely interested:
Most North Americans will have been brought up with the incorrect usage, and will defend it strenuously, but they are wrong. The correct plural is Lego, or, if you want to get specific (as you did in the article), lego pieces or lego bricks. The company spent many years trying to teach correct usage but gave up in the end. But correct is still correct, and if english isn't your first language, there is still time!
Even in the verb usage 'kids playing with their lego' - you don't pluralize the term.