How do people write code? They write instructions, and they have to write them very carefully, because a computer program is a list of instructions for a computer and a computer can't think for itself, so people have to give it those instructions. The people who write them are called programmers, and the code they write is what makes computer programs. There is also a way of thinking that goes with this work, which is called computational thinking. It is the thought process of formulating problems and their solutions so that an information-processing agent, such as a computer, can carry them out. To be carried out by a computer, a solution must be a step-by-step process, which is an algorithm.
Here is a closer look at the word algorithm. An algorithm is a systematic procedure that produces the answer to a problem in a finite number of steps, which means that it is a set of steps that ends. It is also an old idea, because 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. In plain words, it is a way to solve a problem that you can use again and again. Once you have an algorithm, you can ask how good it is, and computer scientists compare how efficient algorithms are using algorithmic complexity, also called Big O notation.
Under every program is binary code. In binary, each digit is either off or on, and it is written as 0 or 1, and each decimal digit from 0 to 9 can be shown with four binary digits, which are called bits. There is a famous name behind this word. Claude Shannon identified the bit as a fundamental unit of information and, coincidentally, the basic unit of computation. Machine language is made of the numeric codes that a computer can run directly. Machine and assembly languages are low-level, so a programmer who uses them must manage a computer's own features of storing and handling data, while high-level languages shield programmers from that work. In other words, a person who writes machine language has to look after those details alone.
High-level languages are designed for people to understand, and they have to be translated before a machine can run them, which is the job of a compiler. A compiler turns code written in a language people can read into the machine code a computer can run. Compilers are very large programs, and they have error-checking and other abilities. Some of them translate to an intermediate assembly language first, while others generate machine language directly. Python is one example of a high-level language, and it is far from the hardware. In other words, people write in a language they can read, and a compiler changes it into code that the machine can run.
Here is how the story of early languages went. Early programmers worked close to the machine, and before FORTRAN, programs were written in machine or assembly language, in binary or hexadecimal arithmetic. John Backus finished Speedcode for IBM's first large-scale scientific computer, the IBM 701. Speedcode needed scarce memory, but it greatly reduced the time needed to write a program. FORTRAN was designed in 1957 by an IBM team led by Backus. Grace Hopper, an American mathematician and a rear admiral in the U.S. Navy, wrote the first computer manual in 1946. In 1949 she joined a company, and 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, and it had many features that inspired the development of COBOL.
COBOL grew out of the 1959 Conference on Data Systems Languages. It was designed to be portable, which means that it could run with little change on computers from different makers, and it was easy to read like ordinary English. Old languages did not simply disappear. FORTRAN became the most often used language for scientific and technical computing over the following decades, and the Computer History Museum says it is still in use as of November 2026. COBOL's popularity declined beginning in the 1990s, but many large organizations, such as banks and government agencies, still used it in the early 21st century. A 1997 study estimated that over 200 billion lines of COBOL code were still in existence, and that this code accounted for 80% of all business software code.
Programs keep track of information in variables, and a variable is like a box that holds a value, and the value inside can change. Variables are not the values themselves, because they are containers for values, and they can hold nearly anything, even whole functions. A program can use a variable to keep track of something that changes, like a score or a count of clicks. A stack is a data structure where the last item added is the first retrieved, which is called last-in, first-out, and a Python list can work as a stack using append and pop. Some problems are solved by a function that calls itself, which is called recursion. It needs a base case that ends it and a recursive case that continues it.
Python is a high-level, general-purpose programming language, and it is object-oriented. Object-oriented languages design software around objects, which can be real-world things such as cars or abstract ideas such as numbers. In other words, an object can stand for a car, or it can stand for a number. Guido van Rossum developed Python in 1991, and it was publicly released in 1994. You may have heard that it is named after a snake, but in fact it was named after the British television series Monty Python's Flying Circus. Python is also open source, so anyone can use it for free.
Programmers also need a way to keep track of their changes, and Git is a version control system. The Git book explains that version control records changes to files over time so you can recall specific versions later. A version control system lets you revert files or a whole project to a previous state, compare changes over time, and see who last modified something that might be causing a problem and when an issue was introduced. Git began in 2005, and its goals included speed, a simple design and being fully distributed.
Mistakes are part of the work, and bugs come in two main kinds, which are syntax errors, mistakes in writing the code, and logic errors, where the instructions are wrong or in the wrong order. The work of 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 can find a bug by checking a program one small step at a time, and a source-level debugger lets them look at variables, set breakpoints and step through the code a line at a time. It is okay to make mistakes in a program, because finding and fixing bugs is a good way to learn.
Words to know
- recursion: self-calling function
- compiler: code translator
- bits: binary digits
- stack: last-in structure
- debugging: finding mistakes