Teach Kids How to Code — Beginner’s Guide

When it comes to kids and sparking passion for technology, a few lines of code done right can go a long way. Here’s a developer’s guide to (not-only-)classroom coding made fun.

Krzysztof Lubiniecki
EL Passion Blog
7 min readJun 12, 2017

--

If you’re a programmer, I don’t need to convince you how great it feels to be able to translate your creative idea to code and later to a real-life project. However, sharing this knowledge with young people either in classroom or at home may seem like a challenge.

The story of EL Kids started a few months ago, when I came up with the idea of running a programming workshop for children. The concept gathered a lot of enthusiasts after I pitched it to my colleagues at EL Passion. We got the green light and kicked-off the project.

The key concept here was designing simple, yet engaging exercises. Not that difficult, and so much fun!

I’m Not a Teacher

It doesn’t matter, neither am I, nor is the team here at EL Passion. Like you, we are people who are passionate about programming and see the opportunities and joy it brings. We have created EL Kids Workshop — a 3 hour journey that takes young people into the world of riddles, algorithms and robots. Thanks to a partnership with an open-minded local school we had a chance to work with students aged 11–12.

You can do it as well, in school or at home. In this post I’d like to share tips and tricks that are designed to work with different age groups (you’ll need to do some tweaking to target the desired age group). But before we go into details…

Why Kids Should Code

I’ll share with you a fantastic quote from 2014 The Guardian piece by Dan Crow on the importance of teaching kids programming skills:

“Next week my daughters turn five. They are growing up in a radically different world to the one I knew when I was a kid. I was one of the generation inspired by the first wave of home computers: I taught myself to program on a ZX81, then a BBC Micro. Those early computers were glacially slow, had almost no storage and you had to write code to get them to do even the simplest task. Today, I have a computer in my pocket that is more than 100,000 times faster and has 10,000,000 times more memory than a ZX81. It is connected to every other computer on the planet and can access virtually every piece of human knowledge ever created, nearly instantaneously. The pace of change in computing is extraordinary.”

For me it’s not about all kids becoming software engineers or landing highly-paid jobs in the future. It’s about avoiding exclusion in the ever-changing digital landscape of the world we (and more importantly they) live in. With Internet of Things movement we can now program anything from light bulbs to refrigerators. It’s not only about spacecrafts and sci-fi movies anymore.

Coding skills will not only help children approach problems in a logical and structured manner, but more importantly will empower them to cross the bridge from users to creators.

Puzzled

I think this can be a surprise — you don’t even need a computer to start! As a first step, you can introduce the concept of computer program as a set of clearly defined instructions that will lead to a desired result when followed closely. Any food recipe is a good example that can help kids understand an algorithm — we have input (flour, eggs, water), procedures (pour, fry, stir) and output (yum, pancakes!).

To reach a learning goal here we’ve created a maze of floor puzzles with riddles. One child would play a role of a robot and others would arrange a set of instructions in specific order to help the robot find its way through the maze. If the instructions lead to an error, like the robot stepping on a wrong puzzle, the participants will have to figure out how to debug their code. In this exercise you can already introduce concepts of conditional expressions and loops. This is a dynamic method that involves both problem solving and physical activity — this combination helps to grab children’s attention and keep them motivated and focused. Wait till you see how happy they are when, after a few rounds of trial and error, they get it right.

Step #1 Puzzled

Let’s Write Some Code

Whenever you feel the time is right, you can turn on the computer. There are various free online resources that can help kids develop programming skills. The one we used is Scratch, a visual programming language designed for kids 8–16 by MIT Media Lab. The power of Scratch lies in simplicity, flexibility (with various building blocks), big community and heaps of tutorials and guides to get you started and inspired. Other links you can find useful are CodeCombat, Gameblox or Code.org Studio.

In our workshop we decided to simulate in Scratch the previous maze exercise in a virtual world. Key learning outcome of this part is a strong message that skills used to build and improve algorithms can be used to make computer do things we want it to do. It also gives kids a possibility to expand their coding vocabulary and find new ways of expression.

During our workshop, after the students had solved the initial problem, they moved on to create their own little projects. Don’t worry about lack of bold programming ideas — children will provide you with plenty of those.

Step #2 Code

Rise of the Robots

I previously mentioned that the Internet of Things movement is gaining a momentum. This means that simple, easy to program and use electronic devices are becoming widely available and affordable. If you want to get kids fired up about coding, this one is an easy winner. Arduino and Raspberry Pi, two famous providers of small hardware for home and classroom projects, offer a variety of products, also combined into starter kits. With huge communities behind them, it’s easy to find online examples of projects, technical specifications and tutorials.

Once you give kids the robots, don’t try to take them away. Seriously. It’s a big deal.

Step #3 The Robots

In this part we explained how to write code that robots can understand. To make things easier, we prepared a library of functions that kids can mix and match to create desired code. A few small exercises with a rising level of complexity led students through the process of discovering the possibilities and limitations of our robots.

We started with trying to move the robot and make it stop where we want it to. Later on we tried to make it dance while kids provided real-time soundtrack. Thanks to proximity sensors, which children instantly recognised as robot eyes, we were able to make robots find and follow each other to play a game of tag. Our robots were based on Arduino software and you can find the repository with this exercise here.

As a side project we created Babelduino — an Arduino library that allows writing and colouring code in languages other than English. Open source rocks!.

What We’ve Learned by Teaching Kids to Code

As trivial as it sounds the only limit when programming with kids is your imagination. Prepare to be surprised and puzzled. I promise you that the passion and creativity with which children turn into detectives, designers and coders will make your teaching efforts worthwhile. As a Latin proverb goes By teaching, we learn. And so will you.

As a Latin proverb goes By teaching, we learn.

Albert Einstein once said that if you can’t explain it simply, you don’t understand it well enough. My EL Kids Workshop team and I learnt that going back to fundamentals of coding knowledge and practice can make us better, more aware and insightful programmers. The students challenged and inspired us. I encourage you to experiment, explore and learn while teaching.

Tap the ❤ button if you feel inspired and want to share programming knowledge with the world.

About the Author

Krzysztof is a senior youth worker and junior Frontend Developer at EL Passion. You can find him on Twitter.

Find EL Passion on Facebook, Twitter and Instagram.

--

--