Referential Transparency
In plain terms
A property where a call can be replaced by its result without changing behavior.
Going deeper
If an expression is referentially transparent, swapping it for its computed value changes nothing, which holds only for pure, side-effect-free functions. It makes reasoning and optimization easy.
Under the hood
Enables safe caching, parallelization, and equational reasoning; broken by any hidden state or side effect.
Examples
Pure functions, Haskell expressions, memoizable computations.
Think of it like...
Like a math expression: 2+2 can always be replaced by 4 anywhere, with no surprises.