Mr. Grummel Get the app
← All notes
LEARNING 5 MIN READ DRAFT — DECEMBER 2027

The three ingredients every single computer program ever written is built from

A variable stores a value under a name, a type tells the program what operations are valid on it, and control flow decides the order code runs in, and together these three are enough to build any program.

Underneath every programming language's own particular syntax and features sit three genuinely universal building blocks. A variable stores a value under a name the program can refer back to later. A type tells the program what kind of value that actually is, a number, a piece of text, a true-or-false flag, and so which operations on it are actually valid. Control flow decides the order the program's instructions actually run in, including which instructions run at all, based on conditions checked as the program executes. Together, these three ingredients are enough to build any program at all, however large or intricate.

Variables and types work together to keep a program's data both flexible and safe

A variable gives a program a way to hold onto a value and refer back to it by name rather than retyping the literal value everywhere it's needed, letting that stored value change as the program runs. A type attached to that variable constrains what kind of value it can actually hold and what operations make sense on it, adding two numbers together is meaningful, adding a number to a block of text usually isn't, and catching that kind of mismatch, either as the program runs or even before it runs at all depending on the language, is exactly what stops a large category of bugs before they ever cause real, unpredictable behaviour.

Control flow is what turns a flat list of instructions into genuinely useful logic

Without control flow, a program would just be a flat, fixed sequence of instructions executed once from top to bottom in exactly the same order every single time, with no ability to react to different inputs or repeat work. Control flow structures, conditional branches that run different code depending on a condition, loops that repeat a block of code multiple times, are what let a program actually respond to different situations, skip irrelevant work, and repeat necessary work without the programmer having to write out every single repetition by hand. It's specifically this branching and repetition, layered on top of variables and types, that turns a static list of instructions into something genuinely capable of solving a real, varying problem.

A variable stores a value under a name, a type tells the program what kind of value that is and what operations are valid on it, and control flow decides the order code actually runs in, and together these three ingredients are enough to build any program, however large or complex.

What we're still unsure about

That variables, types and control flow together form the universal foundation nearly every programming language builds on is well established, confirmed by decades of programming language design across a genuinely huge range of different languages. What's more genuinely a matter of ongoing language-design debate is exactly how strictly a language should enforce its type rules, whether type mismatches should be caught automatically before a program even runs, as in strictly typed languages, or allowed more flexibly and caught only if they actually cause a problem while running, as in more loosely typed languages, and language designers continue to make genuinely different, actively defended choices along that spectrum rather than one approach being agreed as clearly superior.

This sits inside Variables, Types & Control Flow, one of eight topics in Programming, one of seven domains in Computer Science, one of seventeen subjects the app can quiz you on.

Draft — not published yet.
Try the pop quiz