1. result = ask_parent_or_candy(mom, nicely)
2. if result != candy:
3. ask_parent_for_candy(dad, nicely)
I studied analytic and philosophy of language, and i feel that many people in CS don't see the forest through the trees when it comes to programming as such. While some code (e.g. C) handles much more technical aspects of what is actually happening, scripting languages are much better suited to the human mind, and i think creating a natural language language (<-- that seems a bit redundant) is an achievable goal.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.
Also, "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.
1. front_door.open
2. front_door.is_open?
3. front_door.paint(3, :red)
http://mislav.uniqpath.com/poignant-guide/book/chapter-3.htm...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.)
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: https://dl.dropboxusercontent.com/u/5458223/robot_factory.jp...
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. https://dl.dropboxusercontent.com/u/5458223/robot_factory_re...
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: