Sixteen weeksscene 4 / 34~3 min
The cheer feature, written
Week two. Forty lines, on-screen.
Monday of week two. Finn opens an empty file, types a first line, and deletes it. Types it again. This is normal.
What Finn is writing in is a programming languageConcept · lights on your mapprogramming languageA structured way of writing instructions for a computer: precise enough to be translated into something a machine can execute, readable enough for people to create, inspect, and maintain., and the double audience in that definition is the whole trick. Precise enough for the machine. Readable enough for the colleague who inherits it in three years. Every language is a different bargain between those two, and the bargains have names you will meet at the end of this act.
On the screen
max_length = 140def deliver_cheer(cheer, runner):if runner.finished:return droppedsend(cheer, runner.device)The grammar holding it together, which words mean things, where the punctuation goes, what may follow what, is syntaxConcept · lights on your mapsyntaxA language’s grammar rules: which words and symbols carry meaning, where punctuation belongs, how instructions must be arranged. Break them and the code may refuse to run at all, which is called a syntax error.. Break it and the machine refuses to play, loudly and immediately, which turns out to be a kindness.
The text itself, the human-readable file Finn is typing into, is source codeConcept · lights on your mapsource codeThe human-readable text of a program, written by programmers and stored in plain text files. Tools may translate or package it before a machine runs it; the source is where engineers read and change what a program does.. The codebase from scene one is source code by the roomful. And max_length up there is a variableConcept · lights on your mapvariableA name a program attaches to a value, so it can retrieve the value later or attach the name to a new one. How a program remembers while it runs: state, at the smallest possible scale.: a name holding a value, which you met in Act 0 wearing a bigger costume. A variable is state the size of one word.
For a small one-job program, engineers say scriptRecognition — just know it existsscriptAn informal word for a small program written to do one task. The boundary is not exact; the word mostly signals that the software is focused and lightweight., as in I’ll script that. This is not one. This is a feature with Dana’s name on the ticket, and by Thursday of week two it is forty lines that read, honestly, a lot like the box above.
The interesting forty lines are the decisions. Next scene.
End of scene
This scene covers: programming language, syntax, source code, variable, script