TECHNOLOGY
We Used To Worry About Spaghetti Code
Don’t ask AI to understand the whole system every time. Architect the system so it doesn’t have to.
BALKE ASSOCIATES
August 27, 2026
We Used To Worry About Spaghetti Code
Balke Associates — Story of the Week
AI has changed how quickly we can produce software. It may also need to change where we spend our time.
The bottleneck is no longer simply our ability to write code. Increasingly, it is our ability to understand, test, and verify everything that gets written.
We Can Produce Code Faster Than We Can Understand It
AI can generate a remarkable amount of code in very little time. It can add features, refactor modules, trace dependencies, and make sweeping changes across a codebase before a person could finish reading the first file.
That is a real productivity breakthrough.
It is also a real risk.
If we keep measuring progress by how much code we can produce, we may end up building systems that move faster than anyone can reasonably understand. The code may work today. The tests may pass. But if no one can clearly explain where responsibilities begin and end, every future change becomes an act of faith.
The Important Question Is Where AI Is Allowed to Work
Maybe the goal is not to review every line AI writes. At some point, that stops being practical.
Maybe the more important work is defining the boundaries within which AI is allowed to write.
That means decomposing systems into smaller pieces with narrow responsibilities and explicit contracts. Each piece should have a clear purpose. We should know what goes in, what comes out, what it is allowed to know, and how its behavior will be proven.
Build a component. Define its contract. Test the hell out of it. Then treat it as finished.
Not finished in the sense that it can never change. Requirements change. Bugs happen. Better ideas emerge. But a mature component should become boring. Its interface is understood. Its behavior is tested. A change elsewhere should not require AI—or a person—to wander through it looking for surprises.
Architecture Becomes the Containment System
For a long time, software development has centered on implementation: deciding how something should be built and then reviewing the resulting code.
AI shifts the emphasis.
The developer’s highest-value work may increasingly be deciding where things belong, what they are allowed to know about, how they communicate, and how we prove each piece works independently.
In that world, architecture is not an abstract exercise that happens before the real work. Architecture is the containment system for AI.
Good boundaries limit the blast radius of a bad assumption. Stable interfaces make replacements possible. Focused tests let us verify behavior without having to understand the entire system every time something changes.
The Alternative Is Industrial-Scale Spaghetti
The alternative is not just messy code. It is industrial-scale spaghetti: enormous, interconnected codebases written and continuously rewritten by AI, with changes moving across thousands of lines faster than any person can interpret or verify.
We should not be comfortable with a 5,000-line module simply because AI can navigate it. AI’s ability to make a sweeping change does not prove that the change is safe. And a passing test suite does not automatically prove that the system is understandable.
If anything, the easier code becomes to generate, the more disciplined we need to be about structure.
Spend More Time on the Shape of the System
This may mean spending more time on architecture than on coding—or even traditional code review.
It means reviewing contracts before implementations. Testing components at their boundaries. Keeping responsibilities narrow. Making dependencies obvious. Designing systems so that one piece can change without forcing everything around it to change as well.
The point is not to slow AI down. The point is to make its speed useful.
Don’t ask AI to understand the whole system every time. Architect the system so it doesn’t have to.