What is code?
The language computers understand
⏱ Est. ~4 min
01 · Read
Code is text that tells a computer what to do. When you write code, you're writing step-by-step instructions in a language the computer can follow.
You give other people instructions every day: a recipe tells someone how to cook a meal, driving directions tell someone where to turn. Code is the same thing, just written for a computer.
💡 Picture thisCode is like a recipe. A recipe says "mix flour and eggs, then bake at 350 degrees for 20 minutes." Code says "ask the user for their name, then display a greeting." Both are just ordered instructions that produce a result.
Key points
- Code is just plain text — you write it in a regular text file, no special app needed
- Code runs top to bottom, one instruction at a time
- The computer does exactly what you say — nothing more, nothing less
- If you write the instruction wrong, the computer won't guess what you meant — it'll either do the wrong thing or throw an error at you
02 · Code example
The same simple program written three ways: plain English, Python, and JavaScript. Notice how similar they look.
Plain English
1. Ask the user for their name
2. Save their answer
3. Print "Hello, " followed by their name
Python
name = input("What is your name? ")
print("Hello, " + name)
JavaScript
const name = prompt("What is your name?");
console.log("Hello, " + name);
All three versions do exactly the same thing: ask for a name, then say hello. Programming languages are just a more structured way to express the same instructions you'd normally write in English (or any other language).
03 · Quiz
What is code?
- A secret language only experts can read
- Text instructions that tell a computer what to do
- A special kind of file that runs by itself
- Binary 0s and 1s
04 · Fill in the blank
Code runs from top to _____, one instruction at a time.
05 · Match
Match each programming concept to its real-world analogy.
(This section is interactive — please enable JavaScript.)
Other lessons in this chapter
⚠ The full interactive experience needs JavaScript. Please enable it and reload.
※ This is an independent Traditional Chinese teaching project — not an official Anthropic product. Claude™ is a trademark of Anthropic, PBC.