How do people write code? Let us find out. 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. Computational thinking 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. 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.
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. The word algorithm comes from the Latin form of the name of the scholar al-Khwarizmi, and it first referred to the Arabic numeral system. Euclid's Elements, published about 300 BCE, contained an algorithm 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, an algorithm is a plan that people or machines can follow, and it can be used again and again. Computer scientists compare how efficient algorithms are using algorithmic complexity, also called Big O notation.
Let us start at the bottom. Underneath every program is binary code, in which each digit is either off or on, written as 0 or 1. Each decimal digit from 0 to 9 can be shown with four binary digits, which are called bits. Claude Shannon identified the bit as a fundamental unit of information and, coincidentally, the basic unit of computation. ASCII lets machines from different makers exchange data, and its code had 128 unique strings of ones and zeros, each standing for a letter, a number, a punctuation mark, a symbol or a function. Machine language is made of the numeric codes that a computer can run directly, and it is also called binary code or machine code. Machine and assembly languages are low-level, so a programmer must manage a computer's own features of storing and handling data, while high-level languages shield programmers from that work. High-level languages are designed for people to understand, and they are translated before a machine can run them. A compiler translates a whole program written in a higher-level language such as C++, Rust or Java into binary or machine code that can run.
Here are the steps of one person's story, in the order of the dates. Grace Hopper was an American mathematician and a rear admiral in the U.S. Navy, who helped develop computer technology, including UNIVAC I, the first commercial electronic computer. 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, and there she designed one of the first compilers and coined the word compiler. She made an early tool that let people give a computer instructions in English-like words instead of numbers. 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.
Before FORTRAN, programs were written in machine or assembly language, in binary or hexadecimal arithmetic, and FORTRAN shortened that process. John Backus finished Speedcode for IBM's first large-scale scientific computer, the IBM 701, and although Speedcode needed scarce memory, it greatly reduced the time needed to write a program. FORTRAN took three years to develop, led by Backus with a team of 10 IBM employees, and it combined a form of English shorthand with algebraic equations. 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 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. 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, accounting for 80% of all business software code.
Programs keep track of information in variables, and that is where we begin. 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. Every variable gets its own name, so the program can find what is stored in it, and a program can use a variable to keep track of something that changes, like a score or a count of clicks. A data structure is a particular way of organizing data so that it can be used efficiently. An array is an ordered collection of data, and each item has a number called an index, and in JavaScript the numbering starts at zero. A stack is a data structure where the last item added is the first retrieved, which is called last-in, first-out.
Here are a few more ideas, and we will look at them one after the other, in the order that they come. In programming, recursion is when a function calls itself, and it is used to solve problems made of smaller sub-problems, and it needs a base case that ends it and a recursive case that continues it. In programming, abstraction reduces complexity by hiding the technical detail of a system behind a simpler interface, called an API. It can also avoid duplicate code and make code easier to reuse. An API is a set of features and rules inside a software program that lets other software interact with it, as opposed to a human user interface, and it works like a contract between the program that offers it and other software or hardware.
Here is the story of Python, and of its name and its versions. Python was developed by Guido van Rossum in 1991, named after the British television series Monty Python's Flying Circus, and publicly released in 1994. You may have heard that it is named after a snake, but in fact it is named after that television series. Here is how its versions went. Python has had three main versions: Python 1.0 in 1994, Python 2.0 in 2000 and Python 3.0 in 2008, and Python 3.0 is not backward-compatible with earlier versions. The Python team decided that January 1, 2020, was the day they sunset Python 2, so Python 2 is no longer supported. Python is a high-level, object-oriented language that emphasizes readability, which lowers the cost of maintaining programs, and it supports modules and packages, which encourage splitting a program into parts and reusing code.
Here is more about the way people share what they make. Python is open source, so anyone can use it for free. Open source does not just mean access to the source code. The Open Source Definition says the program must include source code and allow distribution in source form as well as compiled form. Under the definition, the license must allow modifications and derived works, and must allow them to be distributed under the same terms as the original software. The license shall not restrict anyone from selling or giving away the software as part of a larger software distribution. The Free Software Foundation's GNU Project says free software is software that respects users' freedom and community. You may have heard that free software always means software that costs no money, but the GNU Project calls this a matter of liberty, not price.
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. Its goals included speed, a simple design and being fully distributed, and it was built to work on the Linux kernel, so it could handle repositories with tens of millions of lines of code from the start. As of 2025, the Linux kernel's source code was 1.7 GB, and Git stored its full history of 1.4 million commits in only 5.5 GB.
Here is one more tool, and it is a good one to look at next. Scratch is a coding tool where kids make their own stories, games and animations, and as of November 2026 it is one example of a tool built on blocks. It was developed at the MIT Media Lab and released to the public in 2007. It is built on blocks that kids drag and snap together, so there is no tricky syntax to type, which is how the Scratch Foundation describes it as of November 2026. In 2019 Scratch was transferred from MIT to the Scratch Foundation, an independent nonprofit that develops and maintains the Scratch platform and community. In short, it is a tool that you use by snapping blocks together. As of November 2026, the Scratch Foundation says Scratch is free because people make it possible, and that its moderators work to keep conversations and projects safe, kind and welcoming.
Last, here is a look at mistakes and how people deal with them. 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. 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 programmers 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. In other words, a mistake is not the end of the work, and it is a normal part of it.
Words to know
- abstraction: hiding detail
- compiler: code translator
- recursion: self-calling function
- bits: binary digits
- interface: simpler front