Lesson 0.2

Programs vs data: what software actually is

Artifact: Telling a program from a data file from a running process

1. The promise

You'll be able to tell a program from a data file from a running process, and you'll know why a program file is dead on disk until something runs it.

2. The mental model

A program is a recipe.

The recipe sits in a cookbook on a shelf, doing nothing. When you open the book and start cooking, the recipe becomes a meal in progress. The meal in progress is a process.

Two cooks following the same recipe at the same time are two processes from one program. One program file. Two running processes. That distinction matters when you open Chrome twice and your Mac fan spins up.

(DIAGRAM: program-to-process — Mermaid flowchart — disk holding a program file, an arrow labelled "OS loads it" pointing to RAM, RAM holding the running process)

The vocabulary, said properly:

  • A program is a file on disk that the OS knows how to run.
  • Data is any file that isn't a program. Your notes, your photos, a spreadsheet, a song.
  • A process is a program that's currently running. It has its own slice of CPU time and its own slice of RAM.

A program on disk is just bytes. The CPU has to load those bytes into RAM and start following them before anything happens. That loading-and-following is what makes a process.

3. You do it, with me

Open the folder where programs live on your machine.

On macOS: open Finder, then click Applications in the sidebar.

(SCREENSHOT: macOS Finder showing /Applications — full window — VSCode.app and Notes.app visible)

On Windows: open File Explorer, type C:\Program Files in the address bar, and press Enter.

(SCREENSHOT: Windows 11 File Explorer showing C:\Program Files — full window — a few Application folders visible)

Look at the icons. Most of these are programs. Each one is a file (or a folder of files on Windows) that the OS knows how to run.

Now look at your Documents folder. The files in there are data. A .docx, a .pdf, a .jpg. None of these are programs. They sit there until a program reads them.

Here's a quick test. Look at this short list and predict which is which before reading on:

  • VSCode.exe
  • notes.txt
  • photo.jpg
  • Cargo.lock

VSCode.exe is the program. The other three are data. Cargo.lock is a data file used by a program (the Rust build tool), but it's still data — the CPU doesn't follow it as instructions.

Now open the tool that shows you running processes.

On macOS: press Cmd+Space, type "Activity Monitor", and press Enter.

On Windows: press Ctrl+Shift+Esc to open Task Manager.

(SCREENSHOT: Activity Monitor on macOS — full window — sorted by CPU% — Chrome processes highlighted)

Scroll the list. Find an app you have open right now (Chrome, your browser, your music player). Notice how much RAM and CPU it's using.

If you have Chrome open, you'll likely see many Chrome rows, not one. Chrome runs one process per tab for security. One program. Many processes.

4. What you should be seeing

Three things on your screen, in order:

  1. A Finder or Explorer window showing programs.
  2. A Documents or Downloads folder showing data files.
  3. Activity Monitor or Task Manager showing processes — at least one app you have open, with its RAM and CPU usage.

If you can point at all three windows and name what each one is showing, you're done with this unit.

5. Common stumbles

  • "Is a Word document a program?" No. The document is data. Word is the program that opens it. The icon on the document might look program-ish, but double-clicking the document tells the OS to launch Word and hand Word the file.
  • "Why are there twenty Chrome processes?" Chrome isolates each tab in its own process. If one tab crashes, the others survive. Same with most modern browsers. One program, many processes — that's the normal state.
  • "The icon on my desktop — is that the program?" The desktop icon is usually a shortcut (called an alias on macOS, a shortcut on Windows). The real program file is in /Applications or C:\Program Files. Right-click the desktop icon and choose "Show Original" (macOS) or "Open file location" (Windows) to see where the program actually lives.

6. You should know

3/16
Next