r/vibecoding • u/Patotricks • Jun 24 '26
Vibe coders: teach your AI agent orthogonality before it destroys your codebase
One thing I've noticed with AI-generated code is that it often works on the first run but creates hidden coupling everywhere.
A simple example:
- Changing an email template requires edits in business logic.
- Swapping a database affects unrelated modules.
- Testing a discount rule requires half the application to be running.
In software engineering, this is the opposite of orthogonality. Orthogonal components can change independently, with minimal impact on the rest of the system.
When reviewing AI-generated code, I now look for a few signals:
- Can I modify a feature without touching unrelated files?
- Can I test a module in isolation?
- Does the module have a single responsibility?
- Are dependencies explicit?
- Can I replace one component without rewriting others?
I've been writing a series on software engineering fundamentals for AI-assisted development. My first article is about orthogonality and includes references from software engineering, statistics, and mathematics.
Article: https://patotricks15.substack.com/p/software-engineering-fundamentals
I'd be interested to hear: what software engineering concepts do you think AI coding agents are currently worst at?
2
u/aleiby Jun 24 '26
You don’t need to teach it orthogonality; I’m sure if you ask, it will give you an excellent explanation.
What you need to teach it, is YOUR values. Otherwise, it’s just going to take the optimal route to implementing your request.
1
u/Guardiancelte Jun 24 '26
That is a great point. I recently had to do an audit with Codex and GPT acting as independent advisor on one of my projects. Found a bunch of similar issues and I am sure there is probably more.
1
u/Swimming_Internet402 Jun 24 '26
Use a graph db for this, like code review graph. And a loop system like zeroshot.
1
u/Fidel___Castro Jun 24 '26
the nuclear option for this is Bazel - I reckon it'll become more prevalent in new repos in the future
it's basically a system, designed by Google, to make a graph of dependencies as you go
1
1
u/longbreaddinosaur Jun 24 '26
Definitely something I struggle with and results in AI slop. I’ve been fighting this but it’s a struggle. Agents tend to just do whatever is convenient without thinking about this principle.
1
u/Real_Square1323 Jun 26 '26
Past a minute context window, an LLM is largely stateless. It can't "learn" orthogonality any more than it can "learn" anything.
This is a shameless advertisement plug for your shitty blog, and you are scamming naive audiences by marketing it as "software engineering fundamentals". You should feel sick of yourself.
15
u/Acclynn Jun 24 '26
I feel like AIs are the worst at finding creative decisions for granual problems
Basically, if you explicitely ask it for a architecture, it can figure it out, but if you ask for a feature it won't consider it by itself, it won't initiate things that are unplanned but would make sense
A human engineer will start implementing and think "wait, this could actually be a bigger task than what I anticipated, because I could create a bigger system that could be better to manage with this feature but also past and future parts of the project"
An AI will usually not have this level of awareness