Immutability
A value that cannot change after construction, so sharing it never risks a caller seeing another caller's edit.
Immutability means a value, once constructed, cannot be modified in place — any "change" produces a new value instead. A string in Java or Python is immutable: s.upper() returns a new string, leaving the original untouched, which is why the same string object can be safely handed to a dozen callers without any of them needing to defend against another mutating it underneath them.
The benefit is aliasing safety. A Race Condition fundamentally requires shared mutable state — two threads can read the same immutable value all day with no coordination, because there is nothing to synchronize over; nobody is writing. Persistent data structures (structural-sharing trees used by Clojure's vectors and maps, or immutable.js) get the ergonomics of "just make a new one" cheap by sharing unchanged subtrees between the old and new versions instead of copying the whole structure, so immutability doesn't have to mean quadratic-copy overhead.
The trade-off is allocation: every "edit" is a new object, which pressures the garbage collector and can defeat cache locality compared to an in-place mutation. Languages differ on the default — Rust makes mutability an explicit opt-in (mut) enforced by the borrow checker; Haskell makes immutability the default and mutation the exception requiring an IORef or similar; JavaScript's const only freezes the binding, not the object it points to, which is a common source of code that's called "immutable" but silently isn't.
Immutability and Pure Functions reinforce each other: a pure function is easiest to write over immutable inputs, because there's no way for it to have caused an externally visible mutation even by accident. The two together are the usual foundation for equational reasoning — replacing an expression with its value without changing the program's meaning — which is much harder to claim once any part of the input could have been mutated mid-computation.
See also7
Closure
A function bundled with the variables from its enclosing scope at the point it was created.
Computation & Algorithms9 connections
Hash Table
A key-value structure that uses a digest of the key to index an array of buckets.
Computation & Algorithms23 connections
Copy-on-Write
Sharing a copy until the moment one side writes to it, deferring the cost of duplication until it's actually needed.
Systems & Tooling12 connections
Determinism
The property that identical inputs produce identical outputs, and the foundation of caching and verification.
Systems & Tooling61 connections
State Management
How a front-end application keeps track of the data that changes as people use it, and decides where each piece lives, from local component state to global stores to server caches.
Web Platform12 connections
Soft Delete
Marking a record as deleted instead of removing it, which makes deletion reversible and auditable but leaks complexity into every query.
Data & Content11 connections
Persistent Data Structure
Data structures that preserve every previous version when changed, sharing unchanged parts between versions so "copying" is cheap.
Computation & Algorithms9 connections
Linked from7
- DeadlockComputation & Algorithms
When two or more processes each wait for something another holds, so none can ever proceed, and the four conditions that must all be true for it to happen.
- Design by ContractTesting & Verification
Specifying what each function requires and guarantees, as checkable preconditions, postconditions, and invariants, so a violation says exactly whose bug it is.
- Garbage CollectionComputation & Algorithms
A runtime automatically reclaiming memory occupied by objects nothing can reach anymore.
- Persistent Data StructureComputation & Algorithms
Data structures that preserve every previous version when changed, sharing unchanged parts between versions so "copying" is cheap.
- Pure FunctionComputation & Algorithms
A function whose output depends only on its input and which causes no observable effect outside itself.
- State ManagementWeb Platform
How a front-end application keeps track of the data that changes as people use it, and decides where each piece lives, from local component state to global stores to server caches.
- UndoDesign & Interface
Letting people reverse what they just did, which makes interfaces safe to explore and usually beats asking "are you sure?" before every action.