How do people write code? Let's start with the people. People called programmers write the code that makes computer programs. So what is a program? A computer program is a list of instructions for a computer. Why does it need a list? A computer can't think for itself, so people have to give it instructions. Let's look at how it all works, one part at a time.
An algorithm is a list of steps for solving a problem or getting something done. You already know one kind. A recipe is an algorithm for people: a list of steps to follow. The steps have to be in the right order. Think about it like this. An algorithm is a precise, ordered set of instructions, and the instructions have to be clear.
Next, think about how a computer reads its list. A computer follows its commands one after another, in the order it is given them. The order of the instructions in a program is called its sequence. What if a job is very big? Here is a word for that. Decomposition means breaking a big problem into smaller parts so it is easier to tackle.
Some jobs need the same steps again and again. Here is a tool for that job. A loop makes a computer repeat a set of instructions. A loop lets code do the same kind of job many times without writing it out again each time. How long does a loop go on? A loop can repeat a set number of times, or repeat until something happens.
A program can also make a choice. It can use commands like IF, THEN and ELSE. Think of a test with two answers. A conditional runs one set of code if a test is true and another if it is not, like taking an umbrella only if it is raining. Here is a way to see it. The test has two answers, and each one has its own path.
A program also has to remember things. A variable is like a box that holds a value, and the value inside can change. How does the program find the right box? Every variable gets its own name, so the program can find what is stored in it. Here is a way to see it. A program can use a variable to keep track of something that changes, like a score or a count of clicks.
Now think about mistakes. Let us look at what they are. A mistake in a computer program is called a bug. Programmers test a program to look for bugs. Debugging means finding and fixing the bugs in a program. Programmers can find a bug by checking a program one small step at a time. There are syntax bugs, which are typing mistakes in the code, and logic bugs.
Code has to be written in a language. Python is a high-level, general-purpose programming language. Python is open source, so anyone can use it for free. Here is a word for the rules. Syntax is the set of rules for how code must be written. A syntax bug is a mistake in writing the code itself, such as a typing error.
There is more than one way to start. Unplugged coding activities use games, cards and puzzles instead of a computer. As of November 2026, Scratch is a coding tool where kids make their own stories, games and animations. Scratch was developed at the MIT Media Lab and released to the public in 2007. Here is one more fact about learning to code. It is okay to make mistakes in a program, because finding and fixing bugs is a good way to learn.
Words to know
- algorithm: list of steps
- loop: repeats steps
- variable: holds a value
- bug: a mistake
- syntax: code writing rules