So far, we have explained that the computer understands only 0s and 1s, and that software is the mediator between the human user and the computer: the set of instructions telling the computer what to do.

In this article, we will talk about programming languages.

A programming language is the way a software engineer writes the set of instructions for the computer.

In the following articles, we will dive deeper and deeper into programming languages; this article lays the foundations for them.

Computers need instructions

Think of a computer as an extremely fast but extremely literal worker.

It can perform tasks very quickly, but you must explain exactly what it should do.

Imagine telling someone:

"Make me coffee."

A person already understands many things that were never explicitly mentioned.

  • They know where the coffee is.
  • They know that water must be heated.
  • They know how much coffee to use.
  • They know that coffee normally goes into a cup.

A computer does not make these assumptions. It needs instructions. Something closer to:

  1. Take a cup.
  2. Put one spoon of coffee into the cup.
  3. Heat 200 milliliters of water.
  4. Pour the water into the cup.
  5. Stir the coffee.

A sequence of instructions like this is essentially what a computer program is.

A program is simply a set of instructions telling a computer what to do.

In software engineering, breaking a task into small steps like this is called an algorithm. The next article will dive into algorithms in more detail.

Writing software is called programming, and the lines of software are called code. Instead of saying "programming software," you can also say "coding software."

In the 1940s, the first electronic computers were programmed literally by hand, by physically rewiring cables and flipping switches, one by one, to represent 0s and 1s directly. Those switches were the program.

This worked, technically. But it was brutal. A tiny mistake, one switch in the wrong position, could mean hours of fixing the code, and there was no shortcut.

Finding and fixing errors in code is called debugging; I will expand on it later.

Every single instruction had to be expressed at the lowest possible level: the level the machine itself understood: 0s and 1s.

Programmers quickly realized this was unsustainable. Human brains are not good at reliably tracking long strings of 0s and 1s. We're good at words, patterns, structure, and shortcuts.

Imagine trying to build a website by writing something like:

10110000 01100001 11001010 00010110

Even a relatively simple application could require millions of instructions.

Nobody sits down and dreams up a website, a banking app, or a video game and thinks, "I shall express this as a string of ten million binary digits."

So, the very first improvement wasn't a change to the computer at all; it was a change to how humans wrote down what they wanted the computer to do.

Enter the programming language

A programming language is a structured language that allows humans to describe instructions in a form that can eventually be translated into something a computer understands.

Instead of writing binary instructions, a programmer might write something like:

print("Hello")

Even if you have never programmed before, you can probably guess what this instruction does. It asks the computer to display the word:

Hello

Most programming languages use English words, which makes them international: a developer from India, a developer from the United States, and a developer from France can work at the same firm, on the same program, without a programming language barrier.

One of the programming language pioneers, Grace Hopper, whose work led to the creation of COBOL, an early high-level programming language still in use today, believed that programming should be simplified with an English-based computer programming language. She insisted:

"It's much easier for most people to write an English statement than it is to use symbols."

A small anecdote: remember I mentioned that finding and fixing an error in a program is called debugging? Well, Grace Hopper is connected to that term as well, after a real bug, a moth, was found inside a computer her team was working on. Upon extraction, the insect was affixed to a log sheet for that day with the notation, "First actual case of bug being found." The remains of the bug can be found taped into the group's logbook at the Smithsonian Institution's National Museum of American History in Washington, D.C.

Programming language evolution

The first real step toward a "language" was something called assembly language, and the idea behind it was refreshingly simple: instead of writing raw binary, give each type of instruction a short, memorable name.

Instead of a string of switches meaning "move this value here," a programmer could write something like MOV A, B, meaning "move the value in B into A." Instead of memorizing which binary pattern meant "add two numbers," you'd write ADD.

This was still extremely close to the computer, every assembly instruction corresponded almost one-to-one with a single operation the processor could physically perform.

The catch? Assembly language still forced you to think exactly the way the machine thinks, one tiny step at a time, one specific memory location at a time. Writing anything complex in it was like building a house by specifying the exact placement of every single brick, nail, and grain of sand. Powerful, but excruciatingly slow.

Thinking in ideas, not switches: high-level languages

The real leap came when people asked a bolder question: what if we didn't just rename the machine's own instructions, but instead created an entirely new language, one built around how humans think about problems, not how the machine executes them?

This gave rise to what we now call high-level languages.

Rather than telling the computer "Move this bit here, flip that switch there," you could write something conceptually closer to a sentence: "take this list of numbers and add them together."

Over the years, many different programming languages were developed; in fact, today we have hundreds of them. Most software developers know how to code in at least 2–3 different languages.

I, for example, code mainly in a language called Java. It's my favorite language, and I have been using it for the past 30 years, but I also know how to code in languages such as Python, C, JavaScript, HTML, SQL, and C#.

Why are there so many programming languages?

If programming languages all communicate instructions to computers, an obvious question arises: why don't we have just one programming language?

For the same reason we don't have one type of vehicle. A motorcycle, truck, Formula One car, and family car can all transport people or objects. But they are designed for different purposes.

Programming languages are similar.

  • Some are particularly useful for websites.
  • Some are popular for mobile applications.
  • Some are designed for operating systems.
  • Some are commonly used for data analysis and artificial intelligence.

Different languages make different trade-offs between simplicity, speed, safety, flexibility, and the kinds of systems they are designed to build.

From programming language to machine language

So far, I have described what a programming language is. But there is still one missing piece.

The computer does not directly understand Python, Java, C++, or most other programming languages.

Eventually, the program must be converted into instructions the computer understands. Special software performs this translation.

Depending on the programming language, you may hear terms such as a compiler or an interpreter.

In languages that use a compiler, when developers finish writing the code, they run the compiler to translate it into binary machine code. Developers call this "compiling the code."

We will examine the difference between a compiler and an interpreter in later articles. At this point, let's just say that whether a compiler or an interpreter is used depends on the programming language.

For now, the important idea is simple:

programmers write instructions in a language convenient for humans, and software translates those instructions into something the computer can execute.

I know you may still feel confused at this stage, but in the next articles we will dive into real examples of programming languages, and things will get clearer.

But before we start talking about the structure of programming languages, there is one more step. The next article will be about algorithms (which I mentioned earlier), because before we talk about how to code, we must understand what to code.