[Not a devops post, but I wanted to share this somewhere.]
I’m the father of four wild and crazy kids, and the two older ones are at the age now (4th grade and 1st grade) that I’ve started trying to get them interested in programming.
At first I wasn’t having much luck. It was always me asking kid #1 whether he wanted to program, and the answer was pretty much always “no”. I started wondering whether he was really mine at all since no spawn-o-mine would answer in that way.
But I eventually changed my approach. Soon my kids were asking me if we could go program. The 4th grader was up on early on Saturday morning programming, programming when it was time for dinner, etc. One day, I was surprised to see one of his pushes show up on my GitHub wall, completely without my involvement. New approach was working.
Yesterday a friend asked me to share some tips, as she has a fourth-grader. Here are some ideas that have been working for me and my kids.
Relate programming to something your kids already care about. It’s the rare child who will find variable assignment, for loops, arrays, etc. inherently interesting, at least at first. But writing a Minecraft mod—now you’re talking. Games in general are a favorite here. But whatever you choose, present programming as a means to an end instead of as an end in itself.
[Note: I'm not saying that a Minecraft mod is an appropriate first project. I've never written one. But the idea that they could write a Minecraft mod was very exciting to my kids. I ended up writing a simple game engine and then having the kids help out with that. You can easily find existing games if you don't want to write your own.]
Start by tweaking rather than writing from scratch. This gives the reward of immediate feedback and offers a gentle and incremental introduction. Learning new concepts, syntax, problem-solving approaches (e.g., divide and conquer)—these are hard enough for adults, let alone a child who hasn’t even taken Algebra I yet.
Introduce simple foundational, not-directly-programming skills. There are lots of examples here and I want to share several.
- Show your kids how to use the basic functions of the IDE (editing, saving, etc.). Just using the tool they see you use (assuming you’re a programmer) can be exciting to them.
- Put their code up on GitHub (or whatever), and show them how to push and pull code from central. The kids learn foundational concepts like “repo-out-there” (networking), that they can share code with siblings on different computers, that they should coordinate if they want to work on the same thing (teamwork), writing commit messages, etc. And with GitHub in particular, the social aspects are fun.
- Content can be initially more engaging than code. So if you have a game, show the kids that they can modify the maps, character definitions and so on by modifying content files. In my kids’ game, there are a bunch of ASCII files that serve as 2D game maps. The game engine requires that each line have exactly the same length. Sometimes when there’s a mistake in the map, the game breaks. The kids learn a ton from working with these maps: the idea that symbols in the map represent tiles in the game, that the computer is really picky about things like whether the line has 119 or 120 characters, how to look at a stack trace for
ArrayIndexOutOfBounds
to know that there’s a mistake in the line length, etc. All foundational stuff. - Configuration is another area that can be fun. Normally when the characters traverse the game map, they can’t walk through walls, over water, etc. They were having to build bridges between all the islands just to see what things looked like. I added a “god mode” flag that allows them to walk anywhere they wanted. Again, good foundational stuff here—the idea of configuration itself (kind of like game cheats), variable assignment and minor coding if your configuration is actually in the code.
Obviously not a complete list (happy to hear additional thoughts), but those have been helpful for my kids.
By Jeff MArtin December 3, 2012 - 8:11 am
What game did you start them with?
By Willie Wheeler December 6, 2012 - 8:20 am
Custom 2D tile game we’re doing. A friend of mine showed me Unity (http://unity3d.com/) though, so I’ll probably look at that since I think it will be easier to create more compelling games, and keep the programming fun (e.g. programming sprite behavior, which is always fun).
By Maarten Meijer December 12, 2012 - 1:40 am
My kidsweren’t interested in programming either, despite he Lego Mindstorms I bought them. Until one the younger one (14) asked me about How to set up Eclipse and stuff on Java, about MySQl, etc. He was heavily into Minecraft mods, adapting a client he found on internet to his purposes. He also setup a Minecraft server with cheat detecting mods, so he could tune his cheat mods not to trigger the cheat detection…
After having to copy/paste every change he made into then next release of the client again, he learned about the need for modularity. Apparently there is a ton of youtube instructions out there on how to set stuff up. Great post!
By Willie Wheeler December 12, 2012 - 9:21 pm
Thanks Maarten. Yeah, I tried the Lego Mindstorm thing too. That was like $300 down the drain. (The Legos slowly got absorbed into the general mass of Legos they have.)
I think that kids are pretty demanding nowadays. My mom used to tell me that when she was a kid, she was happy playing with a stick or a ball. But by the time I was a kid, I was into computers and such so a stick wouldn’t cut it. I think now the kids are going wild crafting things in Minecraft, building huge castles, and all that stuff, and so now Lego Mindstorms isn’t interesting to them.
Several people have written to me telling me that Minecraft modding provided the right gateway for their kids. I believe it.