What Is a Program?
A computer program is simply a sequence of step-by-step instructions that tells a computer what to do. Just as a cooking recipe guides a chef to prepare a meal, a program guides the computer hardware to solve a math problem, display a web page, or play a game.
Before you run a program, it is not active. It sits quietly as a passive file on your storage disk (SSD or hard drive). Only when you launch it does the computer bring those instructions to life.
Why Do Programs Exist?
Early computers in the 1940s had to be physically rewired by hand with cables and vacuum tubes for every single calculation! Computer pioneers like John von Neumann realized: "What if instructions could be stored as data in memory, so the machine could change tasks instantly?" That invention gave birth to modern software.
The Music Box & Sheet Music Analogy
Think of a computer program like sheet music. Sheet music is just ink on paper—it makes no sound on its own. The musician (the CPU) reads the notes (instructions) and plays the instruments (hardware). A different sheet of music immediately turns the same musician into a symphony orchestra or a rock concert.
What Happens When You Click "Run"?
Source Code
You write readable text using a programming language like C, Python, or JavaScript.
a = 15 + 27File on Storage
Saved as bytes on your SSD/disk. At this stage, it uses zero CPU time and zero RAM.
program.exeLoaded into RAM
When you click "Run", the Operating System copies the instructions into high-speed memory.
Process CreatedCPU Execution
The CPU fetches instructions one by one, executes arithmetic, and outputs the result.
Screen Prints "42"The Two Halves of Every Program: Code and Data
Every computer program in existence breaks down into two core elements:
1. Code (The Verbs)
These are the action commands: ADD, MOVE, COMPARE, JUMP. They tell the CPU what calculations or steps to perform.
2. Data (The Nouns)
These are the values operated on: numbers (e.g. 15, 27), user text, images, or audio samples that the code modifies and computes.
Common Beginner Misconceptions
- "A program is the same thing as a process."
Reality: A program is like a recipe in a cookbook—an inert, passive file of text/bytes sitting on your SSD. A process is the chef actually in the kitchen cooking—it has an assigned Process ID (PID), memory allocated in RAM, and active execution on the CPU. - "The CPU executes Python or C code directly."
Reality: The CPU has zero understanding of English words likeif,while, orfunction. It only understands raw binary numbers called machine instructions. Your source code must always be translated first. - "A program runs directly from your hard drive or SSD."
Reality: Hard drives and SSDs are far too slow for the CPU (thousands of times slower than RAM). The operating system always copies instructions into fast RAM before the CPU begins executing them.
Which of the following statements about computer programs is FALSE (a common beginner misconception)?
Lesson 01 Key Takeaways
- A program is a sequence of instructions telling hardware what to compute.
- Source code is human-friendly; machine code is CPU-friendly binary numbers.
- Programs live on storage disks until launched, then load into RAM for CPU execution.
Notessaved locally+
Notes stay in this browser. They are not uploaded.
Suggest an editLearning graph
Discussion
Loading discussion…
Sign in to ask a question.