We’re obsessed with AI generating code. AI tools promise to churn out endless lines of it. But every software engineer worth their salt knows that code is a liability.
Code is a Liability
All software results in behavior. Code is a tool to achieve it. Once written, code is like steel that’s cooled down—rigid and hard to refactor. Every line adds maintenance cost. This cost compounds over time, because more code means more things to maintain, more libraries to update, and more APIs that change with language versions.
Mid Code
The current LLM-based AI code generation tools have been trained on open-source code repositories. They can only generate code in the patterns that they have seen before. Most code is written by developers who are in the middle of the bell curve. Therefore, AI will generate “mid code.”
This will improve over time, but I, for one, am not looking forward to refactoring "mid code". It's painful. I know because I've churned out a lot of "mid code" in my life, and refactored even more.
On Determinism
Determinism is valued in software. We want deterministic outcomes. Probabilistic behavior in software programs can lead to catastrophic outcomes. After all, we don’t want our users to trick our chatbot into selling a car for $1.
But in the spirit of avoiding the $1 sale, we have decided to treat toggling dark mode on/off with the same gravity.
Permissions vs Constraints
There’s a dichotomy between a constraint-based system and a permission-based system.
A permission-based system requires an actor to always have the right set of permissions to achieve an outcome—like a computer program only being able to do something that is written down in the source.
A constraint-based system puts constraints in place. They are guardrails that make sure you don’t flip your car, but the actor has permission-less play within the guardrails.
What if computer code acted like a guardrail instead? What if computer software was designed to achieve probabilistic behavior on a deterministic foundation?
Some Behavior is Inferable
Software developers wouldn’t have to write software for every single use case—especially not toggling dark mode. They would concentrate their efforts on making the foundations—the core business logic—the architecture, more reliable and resilient.
They’d have the time to be creative again without pushing Jira cards that build forms.
There’s a degree of freedom that software programs can enjoy without burning down the house. Most software features aren’t doing things that are mission critical.
Some behavior is inferable. We just need the right abstraction.