What Is Coding? Talking to Computers
A friendly first step into coding for kids: how computers follow instructions, what an algorithm is, and how to find and fix bugs.
CarnielSeriesCoding for Children1 of 4
On this page9 sections
Hi there! Welcome to Coding for Children. In this series you will learn how to give instructions to a computer, step by step. You do not need to know anything yet. You just need to be curious.
Let's start with a big question: what is coding?
Computers Are Very Good Listeners
A computer can do amazing things. It can play music, show cartoons and help a plane fly. But here is a secret: a computer cannot think for itself. It only does what it is told.
And it does exactly what it is told. Not a little bit more. Not a little bit less.
If you tell a friend "grab me a snack," your friend knows what you mean. A computer would ask: Which snack? Where is it? Which hand should I use? How do I open the bag?
So we need to give computers very clear instructions. That is what coding is.
Coding means writing instructions that a computer can follow.
The instructions we write are called code. People who write code are called coders or programmers. After this series, that can be you!
Instructions in Order: Algorithms
You already follow instructions every day. Think about brushing your teeth. You don't just jump in and start brushing. There are steps, and they happen in an order.
A list of steps that solves a problem has a special name. It is called an algorithm (say it like this: AL-go-rith-um).
Here is the algorithm for brushing your teeth:
- Pick up your toothbrush.
- Squeeze on some toothpaste.
- Brush every tooth.
- Rinse your mouth.
- Put the brush away.
A robot could follow these steps one at a time. That is how a computer runs code. It starts at step 1, then does step 2, then step 3, all the way to the end.
Oops! What Is a Bug?
Sometimes the steps are wrong, or they are in the wrong order. Then the computer does something silly. A mistake in code is called a bug.
Imagine you give a robot these steps for getting dressed:
- Put on your shoes.
- Put on your socks.
The robot does exactly what it was told. So it puts the socks on over the shoes! Silly robot? No. Silly instructions.
To fix the bug, we swap the order. Socks first, then shoes. Now it works!
Finding and fixing bugs is called debugging. Every coder makes bugs, even grown-up experts who have coded for years. Bugs are not a sign that you are bad at coding. They are just part of the job. When you find one, you can say "Got you!" and fix it.
Code Is Everywhere
Once you know what code is, you start seeing it all around you. Someone wrote code for each of these:
- Phones run apps, and every app is made of code.
- Video games use code to decide what happens when you press a button.
- Traffic lights use code to know when to change from red to green.
- Microwaves use code to count down the time and beep when food is ready.
- Cars use code for things like the radio, the lights and the screen.
- Washing machines use code to know when to fill, spin and stop.
Look around your home. Can you find three more things that might have code inside?
Try It: Be the Robot
You don't need a computer for this game. You need a grown-up, some bread and something to spread on it, like butter or jam.
- You are the coder. Your grown-up is the robot.
- Tell the robot how to make a sandwich, one step at a time.
- The robot must do exactly what you say. Nothing more.
If you say "put jam on the bread," the robot might put the whole jar on the bread! You will need to say things like "open the jar," "pick up the knife" and "scoop a little jam." Every time the robot does something funny, you have found a bug. Change your steps and try again.
Swap places after. Can you follow your grown-up's steps exactly?
New Words
- Code: instructions written for a computer.
- Coding: writing those instructions.
- Algorithm: a list of steps, in order, that solves a problem.
- Bug: a mistake in code.
- Debugging: finding and fixing bugs.
Quick Quiz
- Does a computer guess what you mean, or does it do exactly what you say?
- What do we call a list of steps in order?
- The robot put socks on over its shoes. What kind of problem is that?
- Name two things in your home that use code.
Answers: 1. It does exactly what you say. 2. An algorithm. 3. A bug (and fixing it is debugging). 4. Lots of answers work, like a TV, a phone or a microwave.
What's Next?
You found out that order matters a lot. In the next episode, Sequences and Loops, you will guide a robot across a grid with arrow cards, and learn a clever trick that lets you do the same steps again and again without writing them out each time.
For Grown-Ups
This episode is unplugged on purpose. The sandwich game teaches the core idea of programming (precise, ordered instructions) better than any screen can, and the giggles when the "robot" misunderstands are part of the lesson. Let your child find and fix the bugs themselves rather than correcting the steps for them. The series moves to Scratch, a free visual coding tool, in episode 3.