Functional Programming
ELI5 — The Vibe Check
Functional programming is like cooking with strict rules: no shared bowls, no side dishes contaminating each other, and every dish must be exactly reproducible from the recipe. Functions take ingredients in and produce output — they never secretly modify the pantry.
Real Talk
Functional Programming is a paradigm that treats computation as the evaluation of pure functions, avoiding shared mutable state and side effects. It emphasises immutability, first-class functions, and declarative style via tools like map, filter, and reduce.
Show Me The Code
const numbers = [1, 2, 3, 4, 5];
// FP style: no mutation, chained transforms
const result = numbers
.filter(n => n % 2 === 0)
.map(n => n * 2);
// [4, 8]
When You'll Hear This
"We adopted a functional programming style to make the data pipeline easier to test." / "Pure functions and no side effects — that's the FP way."
Related Terms
Idempotent
Idempotent means you can do the same thing multiple times and get the same result as doing it once.
Method
A method is just a function that belongs to an object or class. Your Dog object has a bark() method — it's the dog's personal function.
OOP (OOP)
OOP is a way of organising code by modelling the world as objects — things that have properties (what they are) and methods (what they do).
Pure Function
A pure function is the well-behaved kid of programming.
Side Effect
A side effect is when a function secretly does something beyond just giving you an answer — like changing a global variable, writing to a file, or sending...