Course outline · 0% complete

0/27 lessons0%

Course overview →

Computers follow instructions

lesson 1-1 · ~8 min · 1/27

Welcome

This course assumes you have never written a line of code. Every term gets defined the first time it appears, starting now.

A computer is a machine that follows instructions. That is the whole trick. It is not smart, it does not understand anything, and it never gets creative. It just follows instructions extremely fast, billions of steps per second.

A program is a list of instructions written down for a computer to follow. When you open a weather app, a program runs. When a cash register scans a barcode, a program runs. Software is just the collective word for programs.

Every program, from a calculator to a video game, does three things:

  1. Input: it takes information in (a tap, a typed word, a file)
  2. Process: it follows instructions to transform that information
  3. Output: it produces a result (text on screen, a sound, a saved photo)

Keep this triangle in mind. Every program you write in this course will be input, process, output.

InputProcessOutput
Every program has the same shape: information goes in, instructions transform it, a result comes out.

Instructions must be exact

Humans fill in gaps. If a friend says "grab me a drink", you work out the details yourself. Computers cannot do that. An instruction like "make it look nice" means nothing to a machine. Programs must spell out every single step, in order, with no ambiguity.

A program is like a recipe written for the world's most literal cook. If the recipe says "add salt" but never says how much, the literal cook stops or does something absurd. When a program's instructions are wrong or incomplete, the program misbehaves. Programmers call that a bug, and fixing it is called debugging.

To write instructions a computer can follow, we use a programming language: a small, strict vocabulary with exact rules. In this course you will use Python, one of the most popular and beginner-friendly programming languages in the world. Text written in a programming language is called code.

Finding the process step

In a calculator app where you type 8 × 7 and the screen shows 56, the process step is the multiplication the app performs between your tap and the answer appearing.

The three parts line up like this. Your typed keys are the input, 56 on screen is the output, and the process is the hidden middle step where instructions actually compute the answer.

The word "hidden" is doing real work there. The process is the only part you cannot see, which is exactly why it is the part that has to be written down completely. Input and output are visible enough that a mistake announces itself, and a mistake in the middle just produces a confident wrong number.

Naming the middle step

In a music app that takes the song title you tap and plays the sound through the speaker, the middle step is the process.

The tap is the input, the sound is the output, and the process is where the program's instructions run and turn one into the other. In this case that means looking up which file matches the title, reading the file, and feeding the audio to the speaker.

Why the same three words keep fitting

  • The triangle from the top of this lesson is not specific to calculators or music. It is the shape of every program, because a machine that follows instructions has to be given something to work on and has to do something with the result.
  • Input → process → output. Once you can name the three parts of any app you use, you can start guessing how it was built, which is most of what reading code is.