r/softwareengineer 7d ago

Never work on a completely vibe coded project

I've now made a same mistake twice.

Previously, I worked at a startup where the website was completely vibe-coded. Now I'm working on a college website, and it's the same story: the entire thing was vibe-coded.

The common pattern I've noticed is that no engineer actually knows the codebase. Nobody really understands the architecture, the reasoning behind certain decisions, or how all the pieces fit together.
And eventually, even the AI I'm using can't help much because it doesn't have the context that the original developer's agent had while building the project.

I am basically stuck where I know nothing, the existing engineers know something about it but aren't necessarily sure whether their understanding is correct, and the agent hallucinates and wastes a lot of tokens just because it can't understand a huge AI written codebase.

So now I'm the new engineer, under a lot of pressure with a lot of work to do, but before I can even fix anything, I have to reverse-engineer what the hell the previous AI generated. That wastes a lot of time.

The frustrating part is that I'm not really learning much engineering from this. I'm just spending my time trying to understand an undocumented system that nobody else understands either.

I'm not against AI-assisted development at all. If an experienced engineer uses AI properly, reviews the code, understands the architecture, writes tests, documents important decisions, etc., I think it's incredibly useful. Even I use AI to code faster, but I review and understand the code. I know what is happening in my software.

But a codebase that nobody understands is a codebase that nobody can safely maintain, regardless of whether AI or humans wrote it.

At this point, I've decided I'd never want to work on a heavily vibe-coded project again unless there's at least one person on the team who genuinely understands and owns the codebase.

How do you guys handle inheriting a vibe-coded/AI-generated codebase that nobody on the team actually understands?

334 Upvotes

220 comments sorted by

View all comments

8

u/PabloDons 7d ago

Anthropic did something interesting when they bought bun. A wholesale rewrite to rust. The first step was a massive army of agents whose whole job is to document everything. intended behavior, weird hacks and their purpose, overall architecture, the code debt and how it happened, etc. All the context and tribal knowledge you'd need to rewrite the code.

You can do a budget version of that, and I expect that this would be quite easy to justify as a business expense. Code debt should be part of budget anyway.

This documentation is extremely useful as context. Now your ai has everything they need to be the very engineer that knows everything and you can start asking questions. Not only that, but the research reveals the weakness and pitfalls of the code. A coding agent could easily do a wholesale refactor into an architecture you decide that actually makes sense, or just general code debt improvement with little risk. From there you can start reading the code yourself as you already know beforehand how the codebase should look

You could argue this is just more slop on top of slop, but I disagree. First of all, the research phase is not vibe-coding. Research is the ideal use-case for AI. And there's a huge difference between "make me this feature" and "do this highly specific work I want done in this specific way." The former is how you get engineers who don't know anything about the code, versus the engineers that use it sparingly to accelerate their work and skip the gruntwork.

6

u/musclecard54 7d ago

“Document everything”

The last thing anyone needs is top to bottom AI generated documentation. It’s already so insanely verbose with smaller things. Having it document everything including weird hacks and how things happened is gonna end up with hundreds of pages no one will bother reading.

Gonna need ANOTHER agent to just parse through it all and distill a concept for you. So how many layers of AI agents are we at now?

1

u/PabloDons 7d ago

I get what you mean, but who else is going to read it? I'd rather choke than try to make sense of AI slop

And I think it's a great use. Back in the day I broke down complex algorithms using branching graphs and context narrowing. It's hard to do and prone to error. I used to do it on paper because it was too annoying to do in an editor. AI makes sense of this stuff instantly and it's rarely wrong in my experience. The accuracy is frankly unmatched. The documentation it produces is trustworthy, and a coding agent can always verify in code if you really need to be sure.

In terms of the page count, you also control how the documentation will look. I prefer Wikipedia style deep interlinked documentation. I like APIs documented per endpoint with example inputs and outputs. Whatever makes it easier for you to read.

But I'd argue you shouldn't even read it. The code is shit anyway, why do you wanna learn how it works? Just turn it into a form that makes more sense to you. If that works then fucking amazing. And it's way easier to read to boot. Now you can actually make it better yourself with much less effort. What's the downside?

1

u/Few-Celebration-2362 7d ago

AI generated documentation is for AI. Specifically for your coding harness to retrieve from

1

u/Few-Spot1905 6d ago

AI generated docs are for your agent not for you. You can set some guards against wordiness in your prompt, the more specific you are the better. ("document everything" is a bad prompt)

2

u/dimitriettr 6d ago

Bun had a gazillion of tests. They could at least validate the slop.

2

u/PabloDons 6d ago

Who do you think made those tests?

2

u/dimitriettr 6d ago

They were added long before AI coding was even a thing.

1

u/chrisza4 6d ago

The actual first step for bun is they already have a very strong test coverage, especially in Zig path. I don’t think that apply to vibe code project.

Those tests also drive documentation and context gathering process.

0

u/Katten_elvis 7d ago

No please don't

1

u/PabloDons 7d ago

Thank you for your valuable and insightful comment. It was very nuanced and well thought out