Side Effect¶
Core Idea¶
A side effect is an action that produces, beyond its declared and intended result, changes to surrounding state outside its nominal description. The defining commitment is the asymmetry between the action's declared interface and the actual state changes it causes on a shared substrate other actors depend on.
How would you explain it like I'm…
The Sleepy Medicine
More Than The Label Said
Off-Budget Changes
Broad Use¶
- Programming languages: a function that mutates globals, files, or databases beyond its return value; functional programming makes effects explicit via types.
- Pharmacology: a drug that binds off-target receptors; adverse-event reporting surfaces changes its declared mechanism did not name.
- Economic policy: a regulation that moves markets it did not target — the externality is this pattern with a price-system framing.
- Ecology: introducing a species or damming a river produces cascades far beyond the targeted change.
- Organizational change: a process change aimed at one team shifts behavior in others (gaming, attrition, eroded trust).
- Surgery: a procedure aimed at one structure affects surrounding ones; informed consent surfaces the shared-substrate changes.
Clarity¶
It splits "did this intervention work?" into two answerable questions — did the declared effect happen? and what other state changed? — rather than collapsing both into one verdict.
Manages Complexity¶
It compresses software bugs, drug side effects, regulatory spillovers, and ecological cascades into one diagnostic family and a fixed menu: shrink the substrate, declare effects, compensate downstream, refuse, or accept.
Abstract Reasoning¶
It exposes a predictability gradient — side effects are catalogable in a closed substrate, open-ended in an unbounded one — so "what substrate does this action share?" sets the prudence required.
Knowledge Transfer¶
- ML/Haskell → engineering: typed effects transferred into Rust's
unsafemarkers and algebraic-effects systems. - Pharmacology → regulation: adverse-event reporting transferred from drugs into devices, vaccines, and food additives.
- Economics → law/ecology: Pigouvian externality theory transferred into pollution-permit markets and environmental impact assessment.
Example¶
A function int getBalance(Account a) whose signature promises only a return value also writes to a global audit log and mutates a cache — the off-interface change; lifting the effect into an IO type brings it onto the interface.
Relationships to Other Abstractions¶
Current abstraction Side Effect Prime
Parents (1) — more general patterns this builds on
-
Side Effect presupposes Interface Prime
Side Effect presupposes Interface, whose structure must already obtain for the child mechanism to be meaningful or operational.
Children (4) — more specific cases that build on this
-
Externality Prime is a kind of, typical Side Effect
'externality is the side-effect pattern given a price-system framing' — the substrate-specific, priced, third-party instance.
-
Intervention-Coupled Harm Prime is a kind of Side Effect
The harm is by definition a state change outside the intervention's declared benefit interface, riding the same channel as the benefit.
-
Side Channel Attack Prime is a kind of Side Effect
Asserts the is a specialization of directly: "a side channel is specifically the SUBSET of side effects that carry a function of protected state to a measuring observer." side_channel_attack is the informational/ adversarial species of side_effect (the unintended-consequence genus).
-
Adverse Drug Event Domain-specific is a decomposition of Side Effect
Removing pharmacology and surveillance leaves an intervention whose actual change to shared state exceeds its declared therapeutic interface and harms a dependent actor.
Not to Be Confused With¶
- Side Effect is not Interface because a side effect is defined by its escape from the declared boundary, whereas the interface is the boundary itself — widen it to include the change and it ceases to be "side."
- Side Effect is not Externality because side effect is the general structure of which externality is one price-system instance (uncompensated cost to third parties), whereas a function mutating a global has a side effect but no externality.
- Side Effect is not Conflict of Interest because a side effect is a structural fact about an action's reach across shared state, present even with perfectly aligned intentions, whereas a conflict of interest concerns misaligned incentives.