7 Tips for Teaching Your Kids How to Code

  • April 23, 2019

As a developer, you might have noticed that coding is becoming increasingly popular in the playground, with more and more parents ditching Saturday-morning football clubs and art classes in favor of lessons in how to code. So now you have one more reason to share your passion with your children and help them to learn this new skill. It might not initially seem as exciting to them as becoming the new Messi or learning how to ride a bike, but it can absolutely be a fun activity for them and rewarding for all.

Children are fast learners, unintimidated by lines of code, and their imaginations usually run wild, a true asset when it comes to finding creative solutions to problems. A lot of apps have been created with them in mind and use simple languages and basic environments, but teaching code is not only about giving them the right tools, it’s also about patiently showing them how to work well and building automatic reflexes. And with a growing number of companies needing developers and more and more jobs requiring you to have at least a basic understanding of how programming works, taking the time to teach your children how to code is investing in the future. So we asked the experts how they managed to stir up a passion for coding in kids; here are their tips and words of advice.

1. Follow their ideas

When teaching your kids how to code, you might be surprised by how much you’ll deviate from what you originally envisioned. It’s important to ask children what they want to create: Will it be a video game? A short video sequence? An interactive story? And it’s even more important to follow their lead, even if their ideas seem absurd at first. Gauthier Druel is a teacher at Magic Makers, a company that helps kids aged 7 to 15 to learn how to code. He believes you have to trust the process: “Some kids have ambitions that might seem disproportionate [and] their ideas might seem absurd or unfeasible. In those cases, you might be tempted to rein them in. But you’ll soon realize that their curiosity and determination allow them to create incredible games, sometimes coded in a way you would never have come up with.”

What this means is creativity is often a kid’s main asset when it comes to coding. Following their own ideas and understanding their limits will be much more compelling to them than following a predetermined course. Don’t make the mistake of doing things a certain way just because you’ve always done it that way at work: Your child might surprise you with a new solution! Ultimately, don’t hesitate to ditch your plans when it seems like your kids might benefit from it.

2. Stay away from the mouse and keyboard

You might end up wanting to micromanage every interaction they’re having with the software you’re using, especially since children are not usually the greatest typists. Al Sweigart, a software developer and the man behind Inventwithpython.com, who often teaches kids, explains that you should refrain from taking control of the mouse when they’re stuck or you’ll lose their attention. “If they’re having difficulty, it might be tempting to quickly fix the problem yourself and get them back on track,” he says, “but you’ll be robbing them of the experience of fixing the problem and implanting the idea that there are some things that only an adult can do for them.”

It’s a popular tenet of teaching that, when learning a skill, kids tend to retain information better if they’ve come up with the solution themselves. Druel shares this vision: The ideal situation is having kids help each other and come up with the answer with limited input from the teacher. “Key notions are best grasped when the kids are allowed to create by themselves, and also to exchange views with their friends,” he says. “It allows them to share what they understood, and to get advice on things they haven’t quite grasped yet.” You might want to keep this method in mind if you have several children. In general, it’s best to let them go through a trial-and-error process—they will ask you when they really need some input from you.

3. Adapt your teaching style to the age group

When thinking about teaching your children how to code, you might wonder what the right age to start is. As it happens, children can learn how to code at a surprisingly young age. They won’t need to have any knowledge of computers other than how to use a mouse and keyboard—and even this can be learnt quite quickly. For Druel, the right time is when they start to show a strong interest in technology: “We think 7 is the ideal age to start to learn the logic behind coding and electronic devices—smartphones, tablets, etc. At this age, children have already started learning how to read and write, and they will be able to create with coding.”

There are options for younger kids, such as ScratchJr, which is aimed at 5- to 7-year-olds. But if you’re using “real” languages, you might want to wait a bit, says Sweigart: “I think 9 or 10 is a fine age to start learning Python. But really, the age that a child is interested in learning is an age that they can start learning to code.” If your kid wants to learn, even if you think they’re a bit young, start with logical games that emulate the way a program works, or even unrelated lessons to introduce other coding-related skills.

4. Deconceptualize coding and make it fun

Teaching kids how to code is all about the end result. Their interest will be piqued if you tell them they’re going to build a small game rather than learn a programming language. The key to that often is to use offline tools that help to build coding skills and, as Druel explains, a lot of games that kids probably already know can help. “We have small games to introduce key concepts and help understand them better,” he says. “For instance, a game of Battleship, where the rows and columns are all named and numbered, helps with understanding what coordinates on an x and y grid are. But also games of observation, listening, and memory help them think about how a program deals with instructions and syncing.”You can also transform another activity, such as baking, into something related to code: Explain how adding one ingredient after another is similar to a program, teach them accuracy, and allow them to follow their instincts. These skills will translate into coding.

Unsurprisingly, it tends to be easier to deconceptualize coding when you’re teaching kids rather than adults. According to Sweigart, “[Kids] realize that programming isn’t rocket science. It’s much more difficult to teach adults to code, since they’ve often already convinced themselves that programming is something they aren’t smart enough to do.” Because of that, teenagers might feel a bit apprehensive about coding. If that’s the case, start the lessons by showing them source codes. Let them experiment with modifying a line or two and see how it changes the way the program works. As a rule, you shouldn’t avoid showing source codes to kids, because they have to see it’s less complicated than they expected. You just need to do it in a fun way that grabs their attention.

5. Choose the right tools

When picking software, there’s a clear favorite in the world of teachers. Developers often praise Scratch, a coding environment that allows children and teenagers to start understanding the basics of coding with simple commands. With a few strategically placed blocks, kids can create an animated video, a small game, interactive stories, and more. Sweigart says he hasn’t found anything better than Scratch yet, but he’s also fond of the ComputerCraft mod (a modification/add-on created for a game) for Minecraft, which adds programmable robots.

You might also want to start them on something similar to an application programming interface (API), such as Blockly, so they can create their own language rather than use a preset one. Blockly’s main advantage is that it can be translated directly into more grown-up languages.

As kids get older, you’ll want to start them on these “real” languages, starting with the easiest ones. Sweigart is quite partial to Python: “It has a simple, consistent syntax, which gives it a gentle learning curve. Like Java and C#, Python has object-oriented features, but Java and C# force the user to write code in an object-oriented style.” Moreover, Python is used by beginners and experienced software developers alike, which really helps to bridge the gap between users. The programming language you’ll use is important, but try to avoid bringing your negative experiences as a young coder with you: Just because you had trouble learning one language doesn’t mean they will!

6. Go easy on the technical jargon

When you were in school, you probably had a teacher who used so much jargon that what they were trying to teach would fly straight over your head. Remember, it’s the same for your kids. They won’t particularly care for your lesson about design patterns or data structures—at least initially. As mentioned, it’s important to show them source codes and what they produce, but keep the vocabulary to a minimum: First and foremost, they’re here to learn the basics of programming languages. If they’re younger than teenagers, you might also skip some theory at first to give them a more hands-on experience. According to Druel, you’ll want to start creating with them as soon as possible, using apps such as Blockly and Scratch. “[These apps] have the huge advantage of allowing children to visualize the algorithms they’re creating, and to integrate key concepts of programming, instructions, recursions, conditions, and variables, but in a concrete and experimental way,” he says.

7. Let them play

When you’re teaching kids, it’s easy to always be focused on the next module or the next concept to introduce to them. You might think that it’s best to move on quickly when the concepts are fresh in their minds, but first, let them play. It’s a nice reward for them, and it also serves a different purpose, according to Druel. “They love to create their games and, sometimes even more, watch other children play them. The kids will change their projects according to the feedback their friends are giving them. Without realizing, they’ll create complex and interesting games through that iteration process.”

But a gaming session shouldn’t always be about testing either. You’ll have to take off your teaching hat from time to time and just let them play their games and be silly if they feel like it. By doing that, you’ll show them that coding is fun and the process is rewarding, from beginning to end.

There’s no need to be hesitant about teaching your children to code. You’ll be surprised by how fast they learn and how eager they are to find creative solutions when they come across an issue. But more than anything, keep it fun. Kids have the luxury of not being intimidated by coding. Getting them interested early is key to bypassing the mental blocks that might occur when they’re adults. And the skills they’ll learn—creative thinking, logic, and patience—will be used throughout their lives.

This article is part of Behind the Code, the media for developers, by developers. Discover more articles and videos by visiting Behind the Code!

Want to contribute? Get published!

Follow us on Twitter to stay tuned!

Illustrations by WTTJ

Marine Debelloir

Freelance writer

Tags

  • Add to favorites
  • Share on Facebook
  • Share on Twitter
  • Share on LinkedIn

Follow us!

Craving for some answers? We all have career questions. Get inspired weekly.

And on our social networks: