Programming Fundamentals
Programming fundamentals is where the pseudocode from the previous topic finally becomes something a computer actually executes, built from six ingredients that every general-purpose programming language shares no matter how different their syntax looks. A variable is a named storage location that holds a value and can be reassigned — `age = 25` creates a variable named `age` pointing at the number 25 somewhere in memory, and giving it a name instead of a raw memory address is the entire point: readable code over a bare address this series will cover directly in the memory and program execution topic. A data type tells the language what kind of value a variable holds and what operations make sense on it — an integer like 25, a floating-point number like 3.14, a boolean that is only ever true or false, a string of text like "hello" — and most languages either check these types at compile time (catching a mismatch before the program ever runs) or at run time (catching it only when the mismatched operation is actually attempted), a real design tradeoff different languages make differently. Operators combine and compare values: arithmetic operators (+, -, *, /) do math, comparison operators (==, <, >=) produce a boolean answer, and logical operators (AND, OR, NOT) combine boolean values together, which is exactly the Boolean-algebra machinery this series will formalize later in the digital logic topic. Conditions let a program choose between different paths based on a boolean test — `IF temperature > 100 THEN print "boiling"` — which is the direct, literal implementation of the branching a plain sequential list of instructions cannot do on its own. Loops repeat a block of instructions, either a fixed number of times (`FOR i = 1 TO 10`) or until some condition stops being true (`WHILE balance > 0`), which is how a program does a thousand or a million repetitions without a human writing the same line a thousand or a million times. Functions package a reusable chunk of logic under one name, optionally accepting input parameters and returning a result, which is decomposition from the previous topic made real: instead of solving the whole problem inline, a program calls `calculate_tax(price)` and trusts that smaller, separately-tested piece to do its one job correctly. A calculator program is the cleanest possible illustration of all six ingredients working together at once: variables hold the two numbers and the chosen operation, a data type decision governs whether division should produce a whole number or a fraction, conditions branch on which operator the user picked, a function wraps each arithmetic operation so the main program logic stays simple, and — if the calculator keeps running until the user quits — a loop keeps the whole thing alive between calculations.
The next three topics in this series — discrete mathematics to formalize the logic these conditions rely on, debugging and testing to catch the inevitable mistakes in programs built from these six ingredients, and memory and program execution to see what actually happens to a variable's named box at the hardware level — all build directly on the vocabulary introduced here.