Willie Wheeler is a Principal Applications Engineer with Expedia, working on continuous delivery, including build automation, test automation, configuration management and application performance management. He's also the lead author of the book Spring in Practice (Manning). Willie is a DZone MVB and is not an employee of DZone and has posted 23 posts at DZone. You can read more from them at their website. View Full User Profile

How I Got My Kids Into Programming

12.06.2012
| 13384 views |
  • submit to reddit

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.

Published at DZone with permission of Willie Wheeler, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Comments

replied on Wed, 2012/12/12 - 4:18am

Totally true Willie, Minecraft moding works wonders even here in Malmö at CoderDojo Malmö  . Thanks for the write-up!


/peter

Dashell Wieneke replied on Wed, 2012/12/12 - 4:46pm

 Really glad to see that your article did not begin with "I opened up Visual C++ and had my kids start building classes".  I don't know how many time I have seen developers recommend C++ as a starting language for kids instead of something simple like Logo or Xion.

Great article!

Dash

Mitch De Joe replied on Thu, 2012/12/13 - 4:54pm

Nice article.

I'm not in the mood of having kids soon (gee, I'm 20!), but I think that giving 'em a Raspberry PI and have them reading the MagPI - which has a nice column specifically for kids - is also a good thing to do.

Furthermore, even if you are not going to have your kids to program, please teach them how to properly use a computer, not just Internet and games, otherwise you are wasting years of hard work in IT and CT.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.