The biggest design shift of the AI era isn’t about who writes the code. It’s about how long the code is expected to live.
Churn has always been a dirty word in software. Microsoft researchers showed years ago that relative code churn predicts defect density. Adam Tornhill wrote a whole book called Your Code as a Crime Scene, where frequently changed, complex files are the first suspects. GitClear’s research projected that AI assistants would double the share of code rewritten within two weeks of being written, and framed that as downward pressure on quality. The instinct runs deep: code that keeps changing is code that was wrong.
But that instinct comes from a world where writing code was expensive. Durability was how you got your money’s worth. When a feature costs an afternoon instead of a sprint, the math flips. Rewriting something is often cheaper than carefully preserving it, and that’s only going to become more true.
Codebases are gardens now
We’ve always described software in building terms: architecture, foundations, scaffolding, load-bearing walls. Buildings are supposed to stand still.
I think codebases are becoming more like gardens. Specifically, gardens full of annuals. A gardener replants annuals every season, and nobody calls a tomato plant technical debt because it dies in October. The gardener’s real investment goes into what doesn’t turn over: the soil, the beds, the irrigation, the oak tree in the corner. Good structure is exactly what makes replanting cheap.
Code that churns a lot is essentially disposable, and disposable doesn’t have to mean sloppy. It can still be well made. It just isn’t made to last. Quality for an annual means it does its job, it’s tested at its edges, and it can come out without tearing up everything around it.
The problem is that we don’t have a picture of what high-quality churn looks like yet. Our mental model of quality is tangled up with longevity. We brag about code that has run untouched for six years. So churn happens anyway, but implicitly, and it lands wherever is most convenient.
Where churn actually lands
I looked at the last six months of Forem: 563 commits. The most-churned file is app/models/article.rb, touched in 37 of them.
Our spam handler is up there too, at 13. That one I’m happy about. Spam is a seasonal crop. Spammers change tactics constantly, and our code should churn right along with them.
article.rb is the oak tree. When the oak gets dug up every week, it means new features are rooting themselves in the core model because that was the easiest place to plant them. That’s the structural compromise. Churn isn’t the problem. Unplanned churn in load-bearing places is.
Designing for it
A few ideas for making churn explicit instead of accidental:
Name the layers. Say out loud what’s an annual and what’s a perennial. Our AGENTS.md already does a crude version of this by telling AI assistants to tread carefully around core auth, feed sorting, and cache pipelines. That should be more than a warning label. It should be the shape of the codebase.
Put contracts at the edges of the beds. Interfaces, schemas, API specs, and tests that pin behavior rather than implementation are the perennials. Whatever sits behind them can be rewritten freely, by a person or an agent.
Make removal cheap. The test of a good annual is whether you can pull it out without disturbing the bed. If something is meant to churn, it shouldn’t have tendrils in everything.
Measure churn by layer. High churn in the fast layer is a sign of health. Churn in the slow layer is the alarm.
Churn is a design input
Churn is going to happen either way. AI has made it the default rate of change for most of what we build. We can keep treating it as a symptom, or we can treat it as a design input and build the structure that lets us replant with confidence.
I will acknowledge that I have always been more of the perspective that churn is more acceptable than conventional wisdom of software design has implied. I’ve never seen the avoidance of churn as being a good thing in my practical experience. I used to see both sides of the argument, now I am staunchly in the camp that churn is positively associated with the quality and rigidity of our codebases and our systems.
I’d rather tend the garden than pretend it’s a building.
Top comments (9)
One place the annual/perennial line blurs in Next.js is caching. A feature can look easy to remove in the file tree and still be coupled to the rest of the app through a shared cache tag. If it calls
revalidateTagon something broad likeposts, that invalidates every cached entry carrying that tag, including ones used by parts of the app that have nothing to do with the feature. I'd treat cache tags as part of the boundary, not just the folder structure.Also, I love the cover image. Code growing out of the ferns and flowers and along the stepping stones captures the garden idea in one picture. 🌿
Thanks for sharing. Here are my thoughts:
This is true, but I would add another dimension that is equally significant: how far you can push it. At this point, the barrier to writing software has effectively collapsed, anyone with enough patience and a capable model can produce working code for almost any problem. The real differentiator is no longer authorship; it is depth. How far can you push a solution past the first working prototype? Can you harden it against adversarial inputs, scale it under real load, make it legible to the next person who inherits it, and shape it into something that genuinely improves someone's life? Writing code is now the easy part. Turning code into a meaningful solution that solves a real problem, removes real friction, and earns real trust from real users, that is where the difficulty lives, and that difficulty has not decreased at all.
Churn was a concept I had not encountered by this name before, and it is worth interrogating carefully before accepting its implied judgment. First, lines of code as a unit of measurement are deeply misleading, a single line might be a trivial boolean check or a dense chain of arithmetic operations that encodes a week of domain reasoning. Volume is not a proxy for complexity, correctness, or value, and any metric built on it inherits that flaw. That said, I would push back on the conclusion that code that keeps changing is code that was wrong. Nothing in this universe is static. Physics changes our models, requirements change our specs, users change their behavior, and attackers change their tactics. Software that never changes is not software that was written correctly, it is software whose context has not changed yet, or software that nobody is actually using. Change is the signal of a living system. The first working version of anything is a good and necessary step; refinement comes after, and refinement requires change. The real question is not whether code changes, but whether the changes are purposeful, traceable, and structurally contained, which is a question about process and architecture, not about churn as an inherent pathology.
Writing code is still expensive when you account for the full cost, and most people do not. Generating a working feature in an afternoon with AI assistance and shipping it without rigorous security review can expose an entire system to exploitation. A single unvalidated input, a missing permission check, an overly trusted dependency, any of these can hand an attacker the keys to infrastructure that took years to build. When a breach costs you customer trust, regulatory fines, and months of remediation, the "cheap afternoon" feature was not cheap at all. The apparent cost of creation is a fraction of the total cost of ownership. That said, the core argument holds in the right circumstances: when security is handled at the perimeter, when the scope is well-contained, and when the throwaway code is genuinely isolated from critical paths, rewriting is often the rational choice. As AI generation quality improves and security tooling matures to match, the threshold for when rewriting beats preserving will keep shifting downward. The calculus is real, it just requires honesty about all the variables in it, not just the ones that are easy to measure.
The garden analogy is elegant, and it captures something true about composability and soil-level investment. But it breaks down in an important way: gardens are purely additive and seasonal, while codebases are entangled and stateful. A tomato plant that dies in October does not leave behind a tangle of roots that interfere with next year's basil. Code rarely exits that cleanly. A better analogy might be a city. Cities have infrastructure that endures for centuries, sewers, roads, power grids, and buildings that are torn down and rebuilt every few decades, and storefronts that change every few years. Each layer operates on its own timescale and has its own tolerance for disruption. The critical insight is the same as in the garden: the longevity of a component should match its rate of environmental change, not some universal standard of quality. But the city analogy captures what the garden misses: that the layers are deeply interdependent, that changes at one level ripple through others, and that the people living and working inside the system cannot simply step out while you replant. The code that churns most safely is the code that has clean, stable interfaces to everything it touches, not because it was written to last, but because it was written to leave gracefully.
The framing of "disposable software" deserves a sharper challenge. Software is not a physical object that degrades from use, it has no material cost of continued existence. A well-written module that has been running correctly for 3 years costs essentially nothing to keep running. The case for intentional disposability must therefore rest not on the cost of maintenance, but on the cost of understanding: old code accumulates context debt, and at some point it is cheaper to rewrite with fresh understanding than to load all the history of why something is the way it is. That is a legitimate argument. But the conclusion that codebases are becoming more disposable misses the ecological reality: software ecosystems depend on accumulated behavior, and systems that churn too aggressively shed the institutional knowledge embedded in the code itself. The bugs that were fixed, the edge cases that were handled, the performance traps that were avoided, all of that lives in the history of a stable codebase. Disposable code that is not carefully documented and tested at its boundaries does not die cleanly; it takes unwritten knowledge with it. Quality for high-churn code must therefore include not just testing at the edges, but explicit documentation of the reasoning behind every non-obvious decision, precisely because the code will not be around long enough for future maintainers to infer it.
I think we do have a working mental model of high-quality churn, it is just distributed across practices that have not been unified under that label. Consider test-driven development: a codebase where every unit of behavior is covered by a test that runs in isolation can be aggressively rewritten at the implementation level without breaking the contract. The churn is high, but it is bounded and verifiable. Or consider a well-designed microservice architecture, where individual services are replaced wholesale while the interface contract is preserved. The service might be rewritten 3 times in 2 years, and downstream callers never know. Or consider the Unix philosophy, small tools that do one thing well, connected by stable pipes. Each tool can be reimplemented independently because the interface cost is near zero. What these examples share is explicit separation between what a component promises and how it delivers on that promise. High-quality churn is churn that happens entirely inside a stable contract. The mental model exists; it just has not been named and taught as a strategy for managing change velocity rather than minimizing it.
Commit counts, PR counts, and lines of code are among the least meaningful metrics in software, and yet they are among the most frequently cited, largely because they are easy to collect. The same function can be written in 1 line or 20; the 1-line version often took longer, reflects deeper understanding, and is more valuable by any real measure.
A single commit that correctly fixes a subtle race condition in a production system under load is worth more than 50 commits that reformat whitespace or bump a dependency version. The danger of churn metrics is specifically this: they create an incentive gradient that rewards visible activity over invisible correctness. Teams learn to generate commits rather than generate value, and the difference is not always obvious from the outside. The right question to ask of a high-churn file is not "how many times was it touched?" but "what was the nature of each change, and was the system more correct and more capable after each one?" That requires reading the diffs, understanding the domain, and exercising judgment, none of which can be automated into a metric.
This is the clearest possible argument for intentional, expected churn: the adversary itself is the forcing function. Spam and abuse systems are perhaps the most honest codebases in any platform, because their rate of change is directly coupled to real-world signal, the moment they stop changing, they stop working. The fact that the spam handler churns frequently is proof that it is being actively maintained against an adaptive threat. I have noticed this in action here on Dev, where comment abuse is handled quietly and effectively, keeping the community genuinely readable. That kind of unglamorous, continuous maintenance work is easy to undervalue because its success is invisible, you only notice spam filtering when it fails.
Till next time 👋!
The removal test should cover stored data too. If a fast-changing feature adds columns or writes new record types, deleting its code can still leave every future version of article.rb responsible for those records. I'd make the cleanup or compatibility path part of the feature's contract and test removal with a populated database. That separates a replaceable implementation from one that's only easy to replace on a fresh install.
This is one of the clearer framings I’ve seen of the shift.
The building metaphor really is breaking down. When writing code was expensive, durability was the rational goal. Now that rewriting is often cheaper than carefully preserving, treating everything as if it should last for years becomes the expensive choice.
The annuals vs. perennials distinction is especially useful. High churn isn’t inherently bad — high unplanned churn in the load-bearing parts is. Spam handling should turn over constantly. Core models and auth shouldn’t become the path of least resistance just because they’re convenient.
“Make removal cheap” feels like the practical test. If something is meant to be temporary, it shouldn’t grow roots into everything else.
I’d rather tend a garden too. The old instinct to treat all churn as a quality smell is starting to look like an outdated cost model.
Lower implementation cost changes the tradeoff, but it does not remove the need to distinguish exploratory churn from instability. One useful metric would pair churn with the age of the last passing contract/integration test; frequent changes behind a stable contract are a different risk than repeated changes that keep breaking callers.
The garden split matches Anthropic's Claude Code study: the human made about 70 percent of planning decisions but only about 20 percent of execution decisions. The oak is where people still decide, the annuals are mostly agent actions, which is why replanting them is so cheap.
The contrast between the spam handler and article.rb makes the layer argument concrete. I’d also watch how often a change in an “annual” forces edits in the core model: that seems like an early sign that the boundary is leaking, even before defects show up.
so many years have passed and I still use your garden analogy when teaching others. Always nice to see DEV alive and well 🤝
This is the first I've heard of churn, thanks for sharing valuable info!