Facts

Grown-ups

Facts the Peabody Encyclopedia for kids

What grade are you in?

Real facts about everything, written for your grade.

What grade are you in?

Making Machines Understand

How Coding Works: How do people write code?

Read it with Peabody

How do people write code? Computer programming is composing and organizing a collection of instructions in a language the computer understands. Code is the special language that computer programs are written in, and a computer understands it. A computer can't think for itself, so people have to give it instructions. In plain words, a program is a list of instructions for a computer. Games, websites and animation tools are all made with computer programs. A computer follows its commands one after another, in the order it is given them. People called programmers write the code that makes computer programs. That is the whole idea in plain words. A list of steps is something you can follow one at a time, as you do with a recipe.

An algorithm is a list of steps for solving a problem or getting something done. A recipe is an algorithm for people: a list of steps to follow. An algorithm is a systematic procedure that produces the answer to a problem in a finite number of steps. Euclid's Elements, published about 300 BCE, contained one for finding the greatest common divisor of two numbers. An algorithm describes a way to solve a problem so that it can be solved over and over, by people or by machines. The word algorithm comes from the Latin form of the name of the scholar al-Khwarizmi. It first referred to the Arabic numeral system. A recipe is one that you may know well.

Ada Lovelace was an English mathematician who worked with Charles Babbage and created a program for his planned computer. She was born on December 10, 1815, and died on November 27, 1852. In 1843 she translated and annotated an article about Charles Babbage's Analytical Engine. Her notes described how the machine could be programmed to compute Bernoulli numbers. She wrote that the Analytical Engine weaves algebraic patterns, just as the Jacquard loom weaves flowers and leaves. The early programming language Ada was named for her. Ada Lovelace Day is celebrated on the second Tuesday of October, to honor women's contributions to science, technology, engineering and mathematics. In plain words, she wrote notes about a machine and how it could be programmed. Her notes were about a machine that was planned.

Here is what early programmers faced, in plain words. Computers run on binary code, where each digit is either off or on, written 0 or 1. Machine language is made of the numeric codes a computer can run directly. It is also called binary code or machine code. Machine and assembly languages are low-level, while high-level languages are easier for people to read and write. That is the difference between the two kinds. In other words, the machine runs numbers that are either off or on, and some languages are closer to the way people read and write than others, which is the difference between low-level and high-level. Think of what that means for a person at a desk with a long list to write.

She was born December 9, 1906. She was an American mathematician and a rear admiral in the U.S. Navy. In 1946 she wrote the first computer manual, which described how to operate the Mark I calculator at Harvard and was the first extensive treatment of how to program a computer. In 1949 she joined the Eckert-Mauchly Computer Corp. There she designed one of the first compilers and coined the word compiler. In 1957 her division developed Flow-Matic, the first English-language data-processing compiler. It had many features that inspired the development of COBOL. That is the order of her work, year by year. In plain words, she wrote a manual about how to use and how to program a computer.

FORTRAN was created in 1957 by John Backus, and it shortened the old process of writing in machine or assembly language. An IBM team led by John Backus made FORTRAN, a programming language that uses English-like statements. COBOL grew out of the 1959 Conference on Data Systems Languages. It was designed to be portable, running with little change on computers from different makers, and easy to read like ordinary English. A compiler translates code written in a language people can read into the machine code a computer can run. In plain words, it changes words into numbers. Grace Hopper made an early tool that let people give a computer instructions in English-like words instead of numbers.

Every language has rules about how code must be written. Syntax is the set of rules for how code must be written. Syntax only governs the order and structure of code. That means it covers how the code is laid out, and not what the code means. The instructions must also be meaningful, which is the job of semantics. Bugs come in two main kinds: syntax errors, which are mistakes in writing the code, and logic errors, where the instructions are wrong or in the wrong order. A mistake in a computer program is called a bug. A typing error is one kind of mistake. There are two main kinds of bugs, and each one has its own name. In plain words, syntax is about the shape of the code, and semantics is about what it means.

Debugging means finding and fixing the bugs in a program. Debugging involves testing the outcome of programs and looking for any errors or mistakes, either in the original algorithm or in the final program code. Programmers test a program to look for bugs. A source-level debugger lets programmers look at variables, set breakpoints and step through the code a line at a time. Programmers can find a bug by checking a program one small step at a time. That means looking at a small piece, and then the next one. It is okay to make mistakes in a program, because finding and fixing bugs is a good way to learn. So a mistake is a chance to learn. In plain words, a debugger lets a person walk through the code and watch each line.

JavaScript is a scripting or programming language that lets a web page do more than sit there and show static information. A web page's JavaScript generally runs in order from top to bottom, so the order of the code matters. Each browser tab runs its code in its own separate execution environment, so code in one tab cannot directly affect code in another tab. This is a good security measure. Parts of a program can come from an API, a set of ready-made code building blocks that lets a developer build things that would otherwise be hard or impossible. In plain words, each tab keeps its code to itself. The top of the page runs first, and the bottom of the page runs last. So the order is top to bottom.

Computer science is the study of computers and computing, including algorithms, hardware, software and how they are used to process information. Computational thinking could be described as 'thinking like a computer scientist', and it is an important skill for everyone to learn, whether or not they want to be a computer scientist. Code.org launched in 2013 with a video arguing that every student should learn computer science. Its Hour of Code later gave millions of students a chance to write a first line of code, as of November 2026. In plain words, thinking like a computer scientist is a skill that is good for everyone to learn, and it does not matter if you want to be a computer scientist or not. Think of what that means for a person who wants to learn, whether young or old.

Words to know

  • algorithm: list of steps
  • compiler: code translator
  • syntax: code writing rules
  • semantics: meaning
  • debugger: bug-finding tool

Read next

Sources

For grown-ups: Peabody has no ads, not one, and nothing to sell your child. The Kids Pick, an independent kids' directory, rates its games 90/100. See what other free kids' sites load Β· Grown-ups, sign in Β· Already have a profile?