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.
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:
A child using language functionally to get what he or she wants is essentially a form of programming. Example:
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.
You're mistaken I think. Computers essentially process numbers, and even though they are okay for building abstractions, they invariably end up leaking. The complexity in programming is not in the language used to describe it, it's in the details of actually making it work. Syntax is generally irrelevant and only exists to make things easier to read. Also jargon like "String" is actually a holdover from formal logic (so analytic philosophy!).
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
I completely agree with the fact that syntax is irrelevant. What's really key in coding is getting the core concepts down, like variables, control flow, methods, classes, etc. To me, if a kid can understand what a variable is and what a value is, that's awesome, I don't care what language it is. Once they pick up the fundamentals they can go and teach themselves whatever language they want.
Fair point on "string," though i never really encountered it, i opened up an old goldfarb book, and it's not in the index, but it looks like it is used in my old enderton "mathematical introduction to logic," so, again, fair point. I think "statement" would be a better term, maybe.
yeah I wondered about string myself, I don't see how a child could get "strings". I think they would get "letters" or "words" or even "text". That's why I just didn't get into strings, I just let them type stuff and see the result of what they were typing in the simulator which was thrilling. And when it came to teaching variables I went with int's. Even that was a long shot. I just went with "it's just a number" and I think that should be sufficient for lesson #1 :)
I actually thought about what I should start with if I were to teach coding and you're right I would probably start with something that's interpreted first of all. I was thinking Ruby , perhaps Python, you're right.
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.
I feel the language is not as important as the standard library. It should be easy to make interesting things happen. This is where classic BASIC implementations were great. You could just say 'LINE 1,1,50,50' and there was a line.
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'd love to see Logo have a bit of a revival. It's great in that kids can start making pictures immediately, and learn more sophisticated syntax as they need it. The only thing that would make it more appealing to children would be a physical turtle. Maybe a pen plotter would be a reasonable substitute.
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.
I figured you didn't start out with the intention, but yes, i agree that building a simple language for kids would be a very good idea. Perhaps you wouldn't even need words at all. The entire point of generative grammar, if i'm not mistaken, is that logic is pre-programmed into the brain.
You know a long time ago I used to "code" in this language called LabView and it was all graphical. It was designed for electrical engineers. I remember working with electrical engineers that had no idea about coding and they would be able to build complex systems in LabView. You would drag and drop a box and attach it to another box with a connector and that would be a loop, etc. Really awesome. Maybe something visual like that, with colors, animations etc would work for kids.
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.
It's interesting actually, not that you mention it, this week my daughter read her first 20 page kids book. In English, as her second language. Her first language is Romanian and we speak Romanian at home. I do believe this is a beautiful age for kids to see what their brains can do. There's so much potential at this age, and if their curiosity is fostered they end up doing amazing things and starting off with the right foot in life.
With web programming, a lot of the initial hassle and set up is gone, and visual learning/iteration by hitting refresh is very easy. So I would say, almost as young as they can play around with a web browser, and type on a computer. You can immediately start seeing results by typing in the Chrome inspector console. I think even a 4-year-old would be able to understand an if/else, but I'm not behavioral psychologist.
yeah that's a good point; I really wonder about conditional statements though, I think control flow should be straight forward, but I would think you might need to start off with variables and primitives at least.. what do you think?
I started using DOS to run games at around 4, when my dad bought a PC, and taught myself batch programming and QBASIC when I was 6, so I think the ages you mentioned are probably correct.
(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.)
haha that's awesome, I had no idea about a lot of stuff when learning but that's the amazing thing, you don't need to know everything to get started and start building things, and that's what scares people off, they think they have to get a math or comp sci degree to code something basic
that's great man! I'll try that with my 3 and 5-year old boys to see if they pick it up. I was thinking about the whole "how young can a child learn to code" thing too and I think it's obviously a matter of the environment they're used to. If they create a lot, arts/etc, play with Legos for example at a young age, that sort of stuff, they might be inclined to pick up more abstract things at a younger age. My daughter likes doing a lot of math stuff for fun and she has a tendency towards numbers and abstract thinking so she picked it up naturally. We'll see how the boys do in a couple of years :)
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: