What is a program?
A program is a list of precise instructions that a computer follows in order. That's it. Apps, games, websites and AI models are all programs: some have ten lines, some have millions.
Computers are fast but literal
A computer does exactly what you say, never what you meant. Imagine instructing a robot to make tea:
"Make tea." → ❌ The robot doesn't know what "make" or "tea" means.
You need to break it down into steps:
- Fill the kettle with water.
- Switch the kettle on.
- Wait until the water boils.
- Put a tea bag in a cup.
- Pour the boiling water into the cup.
- Wait 3 minutes.
- Remove the tea bag.
Even this skips details: where is the kettle? What if there's no tea bag? Programming is the skill of breaking problems down until each step is simple and unambiguous.
Your first programs in two languages
The same idea in JavaScript and in Python. Press Run on both:
The first time you run Python, your browser downloads the Python interpreter (about 10 MB). After that it's cached and fast.
Different syntax (spelling and punctuation), same concepts. Once you understand the concepts, picking up a new language is much easier.
Input → Process → Output
Most programs follow this shape:
Change quantity to 1 and run it again. The output changes because the program makes a decision.
How code becomes action
You write A tool translates The CPU runs
┌────────────┐ ┌──────────────────┐ ┌──────────────┐
│ source code│ ───▶ │ compiler or │ ───▶ │ machine code │
│ (text) │ │ interpreter │ │ (numbers) │
└────────────┘ └──────────────────┘ └──────────────┘- Source code is just text. You can write it in any editor, and VS Code is the most popular.
- A compiler translates the whole program ahead of time into a file you can run (C, Go, Rust).
- An interpreter reads and runs your code on the fly (Python, and JavaScript in the browser, though modern engines JIT-compile it for speed).
Syntax errors: the computer is strict
One missing bracket and the program won't run. Try it:
Fix them by adding the missing ). Reading error messages is a core programming skill. There's a whole lesson on it later.
Which language should I learn?
| Goal | Good first language |
|---|---|
| Websites and web apps | JavaScript (it's the only language that runs natively in browsers) |
| Data, automation, AI, general purpose | Python (readable and very popular) |
| Android apps | Kotlin |
| iPhone apps | Swift |
| Games | C# (Unity) or C++ |
| Systems, high performance | Go, Rust, C++ |
The concepts transfer. Variables, conditions, loops and functions exist in every language. This track teaches them in both JavaScript and Python.
Practice
Write a program (in either language) that stores your birth year, calculates your age this year, and prints a sentence like "I am 25 years old."
1.What is a program?
2.What does an interpreter do?