Programming Paradigms
A programming paradigm is an overall style for organizing code, and the same calculator program from the programming-fundamentals topic can be written in any of them without changing what it actually computes — only how that computation is structured. Procedural programming is the style this entire series has used so far: a sequence of function calls that run top to bottom, each one operating on data passed into it, the same way the calculator's `add`, `subtract`, and `divide` functions each take two numbers and return a result with no memory of anything else. Object-oriented programming instead bundles data and the functions that operate on it together into one unit called an object — a `Calculator` object would hold its own running total as internal state and expose methods like `.add(5)` that modify that state directly, which is useful whenever a program needs to track many independent things that each carry their own data, like a game's characters or a word-frequency counter's running tally from the data-structures topic. Functional programming goes the opposite direction from objects: it avoids stored, changing state entirely and builds programs out of pure functions, ones that always return the same output for the same input and never modify anything outside themselves, which makes a function's behavior easy to reason about and easy to test in isolation, echoing the debugging-and-testing topic's assertion that a predictable function is a testable function. Event-driven programming organizes code around responding to things that happen rather than a fixed top-to-bottom sequence: a button click, a message arriving, a sensor reading changing — each registers a handler function that the program's event loop calls whenever that specific event occurs, which is exactly how a terminal shell from the working-with-a-computer topic waits for a command, and how a graphical interface waits for a click, rather than running once and exiting. None of these four paradigms is strictly better than the others, and most real programs mix them: a web server might be organized around objects, respond to requests in an event-driven loop, and lean on small pure functions for the parts that transform data without side effects — the paradigm is a tool chosen per problem, not a rule applied everywhere, and recognizing which style a piece of code is already using is often the fastest way to understand it.