The hype and reality of teaching kids to code

Does the “teach your kid to code” movement live up to its claims?

As a science nerd, coder, and tech writer, I knew one part of parenting was going to be a lot of fun. At some point — after my kids were able to dress themselves but before they were too cool to be seen with me in the shopping mall — I’d pull them aside and school them in the arcane art of computer coding.

After all, creating something new is always fun. It doesn’t matter whether you’re working with paper and glue or pixels and bytes. And though I wasn’t a hardcore hacker in my childhood, computers and I had some good times together. Playing pranks on adults. Creating simple text-based games. Finding out how things work (and why they always break). Learning to problem-solve before you panic.

But what I didn’t realize was how the world had changed. Today, technology and coding are at the center of a new educational obsession.

Perhaps it’s because deep thinkers have predicted a future where technology takes over and automation decimates traditional industries. In this future world, the only remaining jobs are for the programmers managing our automated systems and the engineers servicing our robot overloads.

Or perhaps it’s a way to justify our own ever-growing fixation on devices and tech toys. (If you’re going to spend all day on your electronics, isn’t it better to be their master than their slave?)

Or perhaps it’s just the ever-present fear of every generation: that we’ll be left behind in a changed and unfamiliar world.

Whatever the reason, the effect was clear. Suddenly everyone wanted to teach tech.

The rise of STEM

These days, it’s almost impossible to talk about child education without talking about STEM — an acronym for science, technology, engineering, and mathematics.

STEM is as much a snappy brand name as it is an educational concept. And that’s the seed of a serious problem.

As every computer programmer knows, you solve hard problems by choosing a higher level of abstraction. Instead of dealing with tiny details, you plan how complex objects interact. Instead of dealing with piles of objects, you talk about systems. STEM is a higher level of abstraction for selling education. Instead of thinking about details of what you’re learning (like algebra or Java), you think about something that presents itself as a single integrated curriculum. And all of a sudden, that one word has room to cover up some dodgy ideas.

There is plenty of good stuff under the STEM umbrella. And there’s some bad stuff. And there’s a whole bunch of stuff just stuck under the STEM umbrella for the convenience of educators (and for the profit of toy sellers) — stuff that has no business being there.

If you need some examples, try browsing through Amazon’s collection of STEM products. At first, it looks like an embarrassment of educational riches. But crowding out the traditional microscopes and electronics kits are a number of STEM-entertainment products with suspicious claims. Here are some of my favorite examples:

  • Growing crystals on a plastic coral reef “encourages an understanding of underwater ecosystems.”
  • A stick-and-glue modelling kit is a “STEM engineering lab.”
  • Making a baking soda volcano means your kids “learn about the incredible power of geological formations.”
  • A slime science lab “makes science fun” because “your kid will learn all the slimy facts about their slime experiment.” (Hmm.)
  • Digging polished stones out of plaster allows kids to “discover the thrill of real scientific excavation.” And in case you’re skeptical, the box adds this helpful boast: “STEM science learning just doesn’t get any better!”

These products aren’t terrible. After all, toys are fun! Just like you can enjoy a roller coaster without thinking about the way potential energy at the top of a hill changes to kinetic energy at the bottom, you can have great fun with all of these toys, no science needed. But if STEM is just another way to add sparkly marketing dust to something you want to sell, it cheapens the real math and scientific learning that we claim to find so important. After all, we don’t say our kids are training to be a doctors when they play a round of Operation.

The coding simulation

Computer programming belongs in the T of STEM. And just as the overall idea of STEM has been stretched and diluted, so has the classic approach to computer programming. It now faces competition from a host of “code-like” activities. There’s a wide range here, all the way from board games to app-controlled electronic toys.

When I was a child, the programming journey started with a teaching language (like Turing, Pascal, or QuickBasic). These languages might have lacked the performance or features of their grown-up counterparts (say, C++), but they were arranged in the same basic way. Today, kids are offered environments that are specifically tailored to children. Many begin not with a true programming language, but by playing a code-flavored game, like Codecombat, Tynker, Swift Playgrounds, or the Blockly examples on Code.org.

To play a code game, you write code — just enough code for your character to complete a small challenge. For example, you might use code statements to move through a map, pick up gems, find treasure, or fight a battle.

Just like the over-promising STEM toys, these games are plenty of fun. They’re also beautiful to look at — and impressive technical achievements in their own rights. But the more time you spend with them, the less they feel like programming and the more they feel like programming simulations. You aren’t coding, but entering in a virtual world where you use a subset of code commands in highly prepared scenarios. There’s an extra weight of stuff that’s invented just for the purpose of the game (for example, consider the “being damaged” event and the “moveRight” method in the picture shown above). And no matter how many hours you spend playing in these environments, you won’t produce a single line of code that you can take away with you, out of the programming playground.

True programming

The problem with coding games is that they have all the trees but none of the forest.

The trees are the syntax. Syntax can seem weird and exotic to anyone who’s never encountered a line of code before. But syntax is a relatively minor part of the art of programming. Coding games can teach syntax, sure. But it’s often hard to tell where the syntax of the programming language ends and the language of the game intercedes. Seasoned developers know that the programming language owns the curly braces, if statements, semicolons, and so on, while the game owns commands like moveRight. But in the game environment, these concepts are fused together and introduced to kids at the same time.

If the trees are the syntax, the forest is the program — the end product that you’re building. But in a code game, there is no program-making. That’s a problem, because the true experience of programming isn’t learning a few dozen commands. It’s the experience of making a thing, warts and all. It’s an iterative process where you imagine something that doesn’t exist, attempt to create it, test it out, and then get to work fixing it.

This write-build-fix process is central to true programming. Its limits are your own problem-solving ingenuity, not the edges of a map board for a virtual character in a virtual world. When you engage in true programming, you aren’t just learning to write steps of instructions in a programming language — you’re learning to find issues, code around problems, make even bigger mistakes, and gain insight on the way. Programming without this development process is the difference between studying vocabulary flashcards and reading Harry Potter. It’s all the learning with none of the application.

True programming is harder to package up and sell. But if a child slogs through the hard stuff, they’ll get the chance to see what programming really is: not a game to be won, but a mix of problem solving, self-challenge, and creativity. Something that’s not an issue of literacy, but one of passion.

And who knows. It might even be enough to get them spared by the robot overlords of the future.