How To Teach Your Kids To Code. The Right Way.

Ryan Boder
Technology Hits
Published in
8 min readMar 10, 2023
Photo by Thomas Park on Unsplash

Teaching kids to code is a hot topic. I get it. After my son learned to read and do math the tech dad in me started wondering how long it would be before I’d have him using emacs (👎 vim) and building docker images. Kidding, but I did start thinking about whether I should teach him to code and, if so, how to do it. Here is where I landed.

Should I teach my kids to code?

Before asking how to teach your kids to code it’s important to ask if you should teach your kids to code. In this article Joe Morgan makes a case against it. I agree with his overall sentiment but came to a different conclusion. I decided that I should. Not because kids need to learn programming language syntax (they don’t) but because software is a subject in which a lot of great learning can take place while having fun. Computing knowledge is an incredibly powerful tool that I want them to have in their belt. If we can make learning it fun then I’m all for it.

My advice is geared toward moms and dads (or mentors) who have software development experience, or are willing to put in the (substantial) time to learn it. I believe a hands-on mentorship relationship is crucial for something like this. If you’re looking for a code camp where you can send your kids and have them return home as web developers then, I apologize, this article isn’t for you. But if you want to get your hands dirty and do fun projects with your kids then keep reading.

How should I do it?

Software development isn’t primarily about coding. Writing code is just a means to an end. When we can avoid it, we usually do. Software development is about problem solving. I mean real problem solving. Not doing contrived exercises that have a correct solution. Not memorizing the syntax of a programming language. Software development is about mentally modeling a problem or goal, experimentation and creativity. Or at least it should be.

This is even more important when dealing with kids because their tolerance for mundane garbage is even less than yours. Their attention span is short. They’re not motivated by a paycheck or career aspirations. They’re curious, easily distracted, and above all else they want to have fun. If you want to succeed at teaching your kids computing then you have to be willing to see things from their perspective.

This leads to some criteria:

  1. It should result in outcomes they legitimately care about. Your 7 year old doesn’t care about passing unit tests, building web services, or mastering python. If they don’t perceive value in what you’re doing then it won’t work.
  2. It should be easy for them. I don’t mean you shouldn’t challenge them (you should) but you have to do the heavy lifting. Real software development experiences usually involve pain. Setting things up takes work. They aren’t going to RTFM. Even if they did, it was written for adults. Bugs happen and are hard to solve. You need to make sure difficulty doesn’t suck the fun out of your project.
  3. It should revolve around their innate curiosity, interest in experimenting, and desire to be rewarded. I don’t mean artificial rewards like candy. I mean the direct result of the work effort should feel like a reward to them.
  4. It should be something you enjoy doing together. Actually creating things with software is too complex and fraught with pitfalls to send them off to do on their own. You need to be involved so that you can deal with unanticipated obstacles and pivot to something that’s fun again when they lose interest. It’s a great opportunity to bond.

Planning the project

Some example projects that might fit these criteria are making games, animated stories, robots, or art. It entirely depends on your kid and what happens to interest them. Know your customer. In my daughter’s case it’s designing fancy unicorns and hair styles but she’s still a bit young for software development in my opinion. In my son’s case it’s video games.

I set out to find tools we could use to make video games in a way that meets the above criteria. I wanted it to be realistic and not a Fisher Price experience that lacks real programming challenges. And it should result in games he actually wants to play.

After some research, I landed on the Godot game engine. It’s a real game engine that you can build professional games with. It has a simple, python-like programming language called GDScript. The programming language is arbitrary because coding is just a means to an end, not the goal. As a simple, more natural language it will probably be easier for a kid than something like C# or Java. Godot has solid documentation (for me not him) and runnable demos. It’s free and is relatively easy for beginners when it comes to game engines.

The Godot Editor (image by author)

No, this is not an advertisement. Godot fits our needs well. Something else might be a better fit for you. Scratch, for example, is intended for kids and very popular.

Choosing appropriate tools is a good step but we haven’t even started yet. The point is to come up with a project that is easy enough to remain fun for them, revolves around their interests, and results in outcomes they find rewarding enough to be motivated by. Learning to code is just a side effect and doesn’t matter much. The goal setting, mental modeling, experimentation, problem solving, and thought process are what matters. These skills are applicable everywhere in life, not just when developing software.

To explore what might be a good first project we played a variety of games, talked about which ones are the most fun, what makes them fun, and what improvements could make them even more fun. We limited our exploration to 2D (retro) games for simplicity. At first we decided on a 2D platformer like pre-Ninento-64 Mario Bros games. He was into it but it didn’t take long before he started losing interest. We explored more and pivoted to making a race car game which has been working out pretty well since.

What I’ve learned so far

In addition to shorter attention spans, kids don’t do delayed gratification as well as adults. They’re probably not going to stay engaged in a 3 month project where they don’t experience the reward until the end. Make it so they can experience rewards frequently — ideally in each work session. Software projects usually require a start-up effort where you do a bunch of work but see no results for a while. Don’t make them go through that. Start with a demo project or build a walking skeleton that’s already fun to play.

After you have a usable starter project, play it with them and use their feedback to decide what to work on next. Finding improvements that they actually care about helps ensure they’ll stay interested. It’s also an important skill for them to develop. Identifying what to improve (problems) and creating solutions is far more important than learning to code in some programming language. Think of your child not only as a student but also the product owner of your project.

Make it iterative. In the grown-up world we use iterative development to help keep the business/customer and development team on the same page. This is even more important when the customer is a kid. They need to understand and care about every improvement you work on together or they’ll disengage. If they don’t perceive value in it then it just feels like pointless work. It turns out kids are even less tolerant of pointless work than adults.

Do the hard and boring parts yourself. That includes boilerplate, scaffolding, and anything far enough beyond their current level of understanding that it probably won’t be absorbed. Don’t even make them watch that stuff. Do it on your own and then do the interesting work with them. At some point down the road they’ll start to see the value (or at least necessity) of that stuff and be motivated to learn it. Not today.

Don’t forget to have them actually do some of the work. The point is for them to learn so let them do the parts they can handle. Don’t frame it as work they have to do. Think of it as an activity they get to do and always present it that way. You’ve already done the hard and boring parts for them so the remaining work should be fun.

Let them experiment and work at their own pace. As a grown-up it’s hard to empathize with exactly what’s happening in their mind as they do these activities. Things that seem obvious or interesting to you are not necessarily obvious or interesting to them. That doesn’t change just because you’ve thoroughly explained it. Even when it looks like they’re wasting time or just messing around, if you’ve set up the situation and environment well, they’re probably learning. This is a long game, not a crash course. If you force it you just might turn them off of software development all together — the opposite of what you intended. Be there for guidance and support, and as a playmate.

Celebrate and let them show off their achievements. Creating valuable things is intrinsically rewarding. Like adults, kids feel proud of what they’ve accomplished. When they get to share their success with others such as family members, friends, etc… they receive praise and feel rewarded again. It’s just like hanging their painting on the refrigerator. Encourage them to share what they’ve done.

Next steps

We’ve been at it for a couple months now and this is a brain dump of what I’ve learned so far. Much of it is common sense but some I had to learn the hard way. As a dad it can be easy to forget these insights in the moment and do it wrong, even when it should be common sense. As for my son and I, we’re just getting started and we both still have a lot to learn. I’ll follow up with updates as we progress. Right now we’re having a blast building out this race car game.

Our Work In Progress (image by author)

If you liked this article then you might also like Build Your Own Video Game Console.

If you’re interested in chatting about this topic comment below or mention me on Twitter or LinkedIn.

--

--