Lava Flow
dead-metaphor Natural Phenomena → Software Programs
Categories: software-engineering
What It Brings
Volcanic lava flows as a liquid, reshaping the landscape, then cools into basalt — immovable, permanent, part of the terrain. The metaphor maps this geological process onto dead code that solidifies in a codebase: code written during an earlier era of rapid development (the eruption) that hardened into permanent fixtures nobody understands well enough to remove. The lava is no longer active, but it has permanently altered the topography of the system.
Key structural parallels:
- Hot phase as rapid development — an eruption produces fast-moving lava that reshapes everything it touches. In software, this maps to periods of intense, often chaotic development: a prototype phase, a pivot, a crunch before launch. Code is written quickly, requirements change daily, and architectural decisions are made under pressure. The code flows freely during this phase, filling every available space.
- Cooling as knowledge loss — lava cools because the heat source ceases. Code “cools” because the developers who wrote it leave the team, the documentation was never written, and the institutional memory of why the code exists evaporates. What remains is a hardened mass that nobody fully understands. The cooling process is the transition from “we wrote this last week” to “nobody knows what this does.”
- Hardened basalt as untouchable code — cooled basalt is among the hardest natural rocks. Hardened lava-flow code is among the most untouchable artifacts in a codebase. It may contain dead code paths, vestigial features, or abandoned experiments, but removing it feels dangerous because nobody knows what depends on it. Teams route around it the way roads route around volcanic rock formations.
- Geological layering — successive eruptions produce stratified layers of rock. Successive development sprints produce stratified layers of legacy code. Each layer represents a different era of the project, with different conventions, different frameworks, and different assumptions. Reading the codebase is like reading a geological cross-section: you can date the strata by the JavaScript framework they use.
Where It Breaks
- Lava is natural; lava-flow code is human-made — volcanic eruptions are not anyone’s fault. Lava-flow code is the result of human decisions: skipping documentation, not refactoring, losing team members without knowledge transfer. The geological metaphor naturalizes what is actually a process failure, making it feel inevitable rather than preventable. “That’s just lava flow” can become an excuse for not investing in code maintenance.
- Basalt is structurally sound; lava-flow code is not — cooled volcanic rock is stable and can bear enormous weight. Lava-flow code is often structurally fragile: it works by coincidence, depends on undocumented assumptions, and can break unpredictably when the surrounding system changes. The metaphor’s implication of geological permanence is misleading — lava-flow code is more like sandstone than basalt.
- The metaphor has no remediation path — you cannot un-cool lava. You can, however, refactor legacy code. The metaphor’s finality is useful for describing the problem but unhelpful for solving it. By framing dead code as hardened rock, it discourages the excavation work (understanding, testing, incrementally replacing) that is the actual remedy.
- Not all old code is lava flow — the metaphor tempts teams to classify any code they did not write as geological debris. But some legacy code is well-designed, well-documented, and simply unfamiliar. Age alone does not make code lava flow; the defining characteristic is the combination of age and lost understanding. The metaphor can be deployed as a rhetorical weapon against stable, working code that simply looks old.
Expressions
- “That’s lava flow from the prototype phase” — identifying code that hardened from an earlier development era
- “Nobody dares touch the lava” — the defining social dynamic: fear of breaking unknown dependencies
- “Routing around the lava” — building new features that avoid interacting with hardened legacy code
- “Another layer of lava” — recognizing that the current sprint is producing code that will itself become lava flow in the future
- “The lava predates everyone on the team” — the knowledge-loss criterion that distinguishes lava flow from merely old code
- “Archaeological dig” — the process of trying to understand lava-flow code, borrowing a second metaphor to describe the excavation
Origin Story
The lava-flow anti-pattern was cataloged in AntiPatterns: Refactoring Software, Architectures, and Projects in Crisis (Brown et al., 1998), where it describes code that results from premature production of code during the early stages of a project, before requirements and architecture are fully understood. The volcanic metaphor captures the specific temporal dynamic: what was fluid and malleable during development becomes rigid and immovable once deployed.
The term resonated because many developers have inherited codebases with clearly stratified layers of legacy code — each layer a fossil record of a previous team’s rapid development phase. The geological framing provides both a diagnosis (this code is hardened lava) and an implicit prognosis (it is not going anywhere).
References
- Brown, W.J. et al. AntiPatterns: Refactoring Software, Architectures, and Projects in Crisis (1998) — the original cataloging of lava flow as a development anti-pattern
- Sourcemaking.com, “Lava Flow” — widely referenced online description of the anti-pattern with examples and remediation strategies