Topic 13

What Code Is

Concept

Every app on your phone, every website you open, every game you've played — each one is, underneath, a long list of written instructions. Someone sat down and wrote out, step by step, everything the computer should do. That list of instructions is called code, and this topic is about what it actually is.

The surprise for most people is how ordinary it looks. Code isn't a wall of glowing symbols or secret math. It's text — words and punctuation a person typed and saved in a file, much like the text in a document. The difference is what the text is for: it tells a computer exactly what to do.

From an idea to something the computer does
Ideawhat should happen
Written codeexact steps, as text
Computer follows itexactly, step by step
Code is the middle box: the bridge between a human idea and a machine that can only follow precise steps. The whole rest of this chapter unpacks how that middle box gets written and run.

What is code, really?

Code is a set of instructions that tells a computer what to do, written as precise steps in an order. Each line is one small command — show this text, add these two numbers, wait for a click — and the computer does them one after another, top to bottom.

That ordered, step-by-step nature is the heart of it. A computer doesn't take in a whole idea at once and figure out the rest. It needs every step spelled out and arranged in sequence, because it will do them in exactly that sequence and nothing more.

This connects straight back to the earlier topics on the processor. The CPU follows instructions one tiny step at a time; code is where those instructions come from. Writing code is writing the steps the machine will carry out.

It's just text that people write

Code is written by people, typed out like any other text, and saved in ordinary files. Those files are often called source code, or just the source — the original human-written version that everything else is built from. You'll meet that word again in this chapter and in the Git course.

Because it's plain text, code can be read, copied, and edited the same way you'd edit a document. There's nothing magical inside the file. Open one and you'd see lines of words, names, and punctuation — unfamiliar at first, but plainly text someone typed, not a sealed mystery.

Computers are painfully literal

Here is the part that trips up almost everyone new to this: a computer does exactly what the code says, not what the person meant. It has no common sense and never guesses your intent. If the instructions say something slightly wrong, the computer carries out the wrong thing without hesitation.

Think of code as a recipe handed to a cook with zero common sense, who follows it to the letter. The recipe says "add salt" but never says how much, so the cook stops, confused — or dumps in the whole box. A human cook would just use a pinch. The computer is that literal cook: it does precisely what's written, including the gaps and the mistakes.

That's also why a mistake in code is called a bug — an instruction that tells the computer to do the wrong thing, which it then dutifully does. The computer isn't broken when there's a bug; it's faithfully following a flawed instruction. "Bug" is another word you'll see in nearly every course that follows.

A tiny taste of what it looks like

You won't write any code in this course, but it helps to see a few lines so the word stops being abstract. Imagine three instructions, in order: ask the person for their name; store whatever they type; then show the message "Hello," followed by that name.

Real code says almost exactly that, just with stricter wording and punctuation so there's no room for ambiguity. The ideas are readable — ask, store, show — but every detail has to be exact, because the literal machine will follow each step precisely as written and not one bit more.

Common Confusions
  • "Code is unreadable symbols only a genius understands." Code is text written by people, made of words and punctuation. It looks unfamiliar at first, the way a foreign language does, but it's readable text — not secret symbols.
  • "The computer understands what I mean." It doesn't. It follows the exact written steps, with no common sense and no guessing. If the steps are slightly wrong, it does the wrong thing without noticing.
  • "The code and the app are two separate things." The app is what you get when the computer runs the code. The code is the instructions; the running app is those instructions being carried out.
  • "A bug means the computer is broken." A bug is a mistake in the instructions, not a fault in the machine. The computer is working fine — it's faithfully doing exactly what a flawed line of code told it to do.
Why It Matters
  • "Code," "source," and "bug" turn up in nearly every technical course and conversation — this is where they stop being vague.
  • Knowing the computer is literal explains why software has bugs at all: a wrong instruction is followed exactly, not corrected.
  • It sets up the rest of this chapter — programming languages, and how written code becomes a running program.
  • It's the foundation for the Git course, which is all about managing and changing source code over time.

Knowledge Check

Which of these best describes what code is?

  • A list of precise step-by-step instructions, written as text, telling the computer what to do
  • A set of secret symbols and hidden mathematics that only specially trained experts are able to read
  • A physical part fitted inside the computer that quietly stores all of your photos and apps
  • The finished app shown on your screen that you tap and interact with directly

A line of code tells the computer to do something slightly wrong. What happens?

  • It notices the mistake and quietly fixes it to match what you actually meant
  • It does exactly what the line says, carrying out the wrong thing without noticing
  • The computer breaks, because the wrong instruction somehow physically damages the machine inside
  • It stops and politely asks you to explain what you really intended before it continues

Someone says "I found a bug in the app." What does that mean?

  • A part inside the computer has physically failed and needs to be replaced
  • The app has lost its connection to the internet and can't load data
  • A mistake in the code makes the computer do the wrong thing
  • A real insect has gotten inside the device and is interfering with it

You got correct