Before You Start: The Words This Series Keeps Using

The handful of terms this Functional-Light JavaScript series uses constantly: function, procedure, side effect, pure function, surface area, confidence. Explained once in plain language.

September 7, 20263 min read

This series teaches functional programming in JavaScript, one idea at a time, starting from what actually makes something a function at all. It assumes you can already write basic JavaScript. It does not assume you already know any functional programming vocabulary.

This page exists to close that gap. Read it once before starting, or come back any time a word shows up later and doesn't immediately click. Simplifying the sentences around a word is not the same as skipping the word, this series keeps the real terms on purpose, because they're exactly what you'd use to explain your code to someone else later.

The Words This Series Uses Constantly

Function

A piece of code that takes some input and gives back an output, using only what it was handed. Nothing sneaks in, nothing leaks out. If you give it the same input twice, you get the same output twice, always.

Procedure

A named block of code that does something, but doesn't cleanly hand back a value the way a function does. Printing something to the screen, saving something to a file, these are procedures. Procedures aren't wrong or bad, a program needs them, they're just a different thing from a function.

Side Effect

Anything a piece of code does that reaches outside itself: changing a variable it wasn't handed, printing to a screen, saving to a database, checking the time. A real function isn't allowed to have any. The first post that explains this in full.

Side Cause

The other direction of a side effect: instead of reaching out, code reaches in and reads something it wasn't handed, like a variable sitting outside the function. Most people just call both directions "side effects."

Pure Function

A function with no side effects and no side causes at all. Same input in, same output out, every single time, no exceptions. This is the actual goal this whole series is working toward.

Surface Area

How many spots in your code could possibly change a given value. A value with a small surface area (like a variable only one small function ever touches) is easy to trust. A value with a huge surface area (like a variable the entire program can reach) is much harder to trust, because there are so many places it could quietly change.

Confidence (Level of)

Whether a function call is pure isn't always a clean yes or no in real code, sometimes you just can't see everything that could affect it. So instead of demanding a verdict, this series asks how confident you are, and works to make that confidence as high as possible.

Closure

When an inner function remembers a variable from the function that created it, even after that outer function has already finished running. This series uses closures a few times before formally explaining them, since a full post on the topic is still coming.

Partial Application / Currying

Giving a function some of its inputs now, and getting back a new function that remembers them and waits for the rest. You've already seen this technique used in this series, this series comes back to name it properly and explain it in full later.

Keep this page open in another tab for the first few posts. Once these words stop needing a second look, you won't need it anymore.