Level 0 · Base Camp

What Programming Actually Is 📜

Programming is writing instructions for something that cannot infer, assume, or use common sense. It is less like maths and more like writing very careful stage directions for an actor who takes everything literally.

The peanut butter sandwich problem

There is a classic classroom exercise. Children write instructions for making a peanut butter sandwich, and the teacher follows them exactly. "Put the peanut butter on the bread" gets the teacher pressing an unopened jar onto an unopened loaf. The room dissolves. A lesson is learned.

That teacher is the computer. Programming is the skill of writing instructions so complete and so unambiguous that a determined literalist cannot get them wrong. It is not about being clever. It is about being precise, which is a different and much more learnable skill.

DRAMA[Easy: Success]

Ah, but the machine is not merely literal, is it? It is hostile in its literalism. It will find the one interpretation you did not intend and commit to it entirely, the way a bad actor finds the one reading of a line that ruins the scene.

An algorithm is just a plan

The word sounds like a magic spell. It means "a list of steps that finishes". You use them constantly:

Programming is: work out the steps (the hard part, done in your head or on paper), then write them in a language the machine accepts (the easy part, which is what this course teaches).

🎮 You have already done this

If you have ever set up a crafting queue in a game, written a macro, built a redstone contraption, or configured a spreadsheet formula, you have programmed. You just did not have to fight anyone about semicolons.

The three moves

Nearly every program ever written is built from three moves, and Level 1 of this course is basically a tour of them:

MoveWhat it meansIn English
SequenceDo this, then this, then this"Open the door, walk in, close the door"
SelectionChoose between paths"If it is locked, use the key"
RepetitionDo it again"Keep knocking until someone answers"

That is the entire toolkit. Add a way to store values (variables) and a way to bundle steps under a name (functions) and you can, in principle, write anything: a game, a browser, a bank, a chatbot. Everything else is convenience, speed and taste.

Why languages exist

The CPU wants numbers. Humans want words. A programming language is the negotiated settlement. Here is the same idea at three altitudes:

LevelLooks likeWho writes this
Machine code10110000 01100001Nobody, on purpose, since about 1955
Assemblymov al, 0x61Compiler authors, chip people, demoscene heroes
Pythonletter = "a"You, in about ten minutes

Two ways exist to get from the top row to the bottom row:

Python is interpreted, which is why you will be running real code inside a web page thirty seconds from now, with nothing installed. It is also why our sister school's language, Rust, will run circles around it in a benchmark. Both facts are fine. They are the same trade seen from two sides.

LOGIC[Medium: Success]

Note the honest framing: not 'Python is slow' but 'Python trades machine time for your time'. Your time costs more than the computer's, right up until the moment it does not, and knowing where that line sits is most of what senior engineers are paid for.

What programmers actually do all day

Not typing. Typing is maybe fifteen minutes of it. The real job:

Exercise 1

Be the computer

Here are instructions for brushing your teeth. Follow them with maximum literal-mindedness and find at least three ways they go wrong:

  1. Pick up the toothbrush.
  2. Put toothpaste on it.
  3. Brush your teeth for two minutes.
  4. Rinse.
Reveal solution

A few of the many: the toothpaste tube is closed, and nothing said to open it. 'Put toothpaste on it' does not say how much, so you use the whole tube. 'Brush your teeth' does not say to put the brush in your mouth. 'Rinse' does not say rinse what, so you rinse the cat.

Every one of those is a bug you will genuinely write this year. The mistake is never stupidity. It is assuming shared context with something that has none.

Exercise 2

Spot the three moves

Describe how a vending machine works in five or six steps. Then label each step as sequence, selection or repetition.

Reveal solution

One reasonable answer:

  1. Wait for a coin. (repetition: keep waiting)
  2. Add the coin's value to the total. (sequence)
  3. If the total is less than the price, go back to step 1. (selection, then repetition)
  4. Wait for a button press. (repetition)
  5. If that slot is empty, refund and stop. Otherwise drop the item. (selection)
  6. Return the change. (sequence)

You have just designed a program. The rest of this course is notation.

+100 XP