Hacker News new | ask | show | jobs
by t-writescode 99 days ago
So, I admit that I'm finally getting into this "let Claude help you write code" stuff, and I'm enjoying it a bit for the stuff I, honestly, just don't want to write; but ... I still read it. I still review it. I still look at the code like I'm peer-reviewing it and go, "Uh ... I don't like this area at all. That's going to be really hard to debug at 3am" and so on.

I guess my thought / question is: this is your code. Why are you submitting the code to the git repo like that, with all the wrong text? I get making mistakes here or there; but ... everywhere? Enough that it's causing huge problems you can't quickly correct?

And ... aren't you lucky you still *have* the context in your mind? What if you hadn't caught it, or someone else had done that and you inherited that code with those wrong comments that you let through the PR and into the main branch?

4 comments

The problem, in my experience is:

1. It writes SO MUCH code, in minutes, that theres no way I as a human can review it.

2. I am not very motivated to read/review this code anyway: it was cheaply written, by some _thing_ that is not going to improve from my feedback.

3. If you DO review it conscientiously , it becomes a never ending thing: you keep finding issue upon issue.

4. If you report the issues for fixes, the fixes normally fix that immediate issue, and typically add another parallel path/another option/another 100-odd lines of code, instead of a structural fix.

5. If the code base is large, and if you let AI write a meaningful amount of code in it, its no longer _your_ code. You lose the depth+width of understanding needed to reason thru things mentally, cause you no longer KNOW enough about the code.

6. If you do review seriously, and either fix things yourself, or have the ai/harness fix the issues for you, the rounds of fixes take so long, if you look back you realize it would have been better to just do it yourself in the first place.

My personal opinion there are really only two choices:

A. If you want to build FAST, using an agent, just let the agent write tests, validations, extensively, have it keep running them (it likes to call them gates), and just let it loose. Give up on the idea that its your code, and that you understand it. The bottom line becomes: does it work, and WHEN it breaks in weird ways, just use the agent to find and fix the issue (probably breaking something else in the process).

B. limit AI use for non trivial, prod-quality projects to limited research, very tiny targeted changes, write most of the code yourself still, and review every line. You won't get much speedup, maybe 20-30%, but it will still be YOUR code, and you will still be able to reason about it.

Route A seems genuinely horrifying to me - maybe not for small and/or helper scripts; but for anything substantial. For anything that bites you or someone else hard when things go bad.

I don’t want a vibe-coded, mass-produced diabetes tracking app, or banking tool, or tax management software. I don’t want a vibe-coded power grid analysis software.

I don’t care if a person’s little, local scripting thing is vibe-coded. I don’t care if an artist’s 0->1 game code is vibe-coded; but that’s not what a lot of the things we’re talking about here really are.

Route A is good for rapid, disposable prototyping. If you ever have a stray thought, “I wonder how this would work if the whole paradigm were turned sideways”, you now have a chance to preview a “working” version of your idea. If you like it, discard the code and reimplement it correctly. In this way, I think it can be a good adjunct to sketches and other lofi prototyping techniques. Just don’t outsource the creative ideation to the LLM, because all you’ll get are the same solutions as everyone else.
Have you seen many of the replies in this thread and others? They’re not doing that. They’re putting it into production code. Their company’s thought leaders are trying to say that review itself is a waste of time, etc.

That’s not “disposable prototyping” that’s whole versions of the codebase written with barely a human in sight.

Yes; my point was not related to any of that.
Route A is what concretely what is behind those "a select few are seeing 100x productivity increases" posts. agents bring enterprise-level engineering to the IC. your average enterprise PM has no idea how the code works either but knows who to call when it breaks or needs a new feature added. the industry split on agentic use lies in how much and to what degree you believe "but AI is different!" in this analogy
You should be the one building the gates then, but those gates should be mechanical and deterministic so the AI doesn’t wprk around them. Lint rules, type errors, commit lint, anything that tells the AI to stop instead of allowing workarounds.
> Lint rules, type errors, commit lint, anything

These are basic: they work for human coders and are typically quick to setup. But gates at this level are far from enough for agentic coding. You need an extensive test suite/e2e suite/benchmark suite. Typically much larger than the code base itself: This is what enables those "i ported bun to rust in a weekend" headlines. Where ever such extensive 'gates', high quality ones, already exist, the agent can do a good job of making things work, cause it can automatically iterate.

But: every hole, every gap in coverage, will be eventually found by the coding agent and 'exploited'. So you need full, extensive coverage.

This suite itself is a LOT of work, much more than what it would be if you only had to worry about human coders. So if YOU are writing the gates yourself, you are going to fall between A and B: you still have a convoluted, unreliable, impossible-to-reason-about prod app, AND it still took you eons to build it cause you spent that time writing the gates. This is no win at all, on either front.

Where gates, extensive ones, help in route A is they can significantly reduce the churn/spinning, fix-x-break-y, to just the parts that are gaps in coverage (which the agent will keep finding at a ridiculous rate). And your work would be to have it ALSO keep filing in those gaps with more tests/etc.

One of the reasons go coding with agents works better than other langs is cause I even include AST based enforcements in my governance suite. Its still route A, but with somewhat more confidence, somewhat less frustration.

I mean, from my training long ago, a good test suite is usually / always a few multiples in size of the codebase.

100k lines of app code? 300-500k lines of test, sort of thing.

Exactly.

I am now looking at 9 to 10x the app code, for non trivial stuff. And this is not just the usual unit/integration/e2e suites too. Extensive deadcode, field use, code shape tests (ast walking) - god objects, 15-param helpers, wrapper-piled-upon-wrapper, badly named (a skill) functions/methods/objects, path-dependent artifacts, etc. There is no way I could have written all this manually.

It doesn't guarentee high quality OR reliability or readability or maintainability, but does reduce churn and makes me feel a bit more confident about deploying route A work product in prod.

Tests are also a good mechanical and deterministic guardrails, but they're written by the same AI that wrote the code then what's the difference?
> So, I admit that I'm finally getting into this "let Claude help you write code" stuff, and I'm enjoying it a bit for the stuff I, honestly, just don't want to write; but ... I still read it. I still review it. I still look at the code like I'm peer-reviewing it and go, "Uh ... I don't like this area at all. That's going to be really hard to debug at 3am" and so on.

I used to. I've stopped in recent months, only because I just can't keep up with the pace it's churning out the code. If I was to read it, it would take multiples longer to develop anything, maybe into orders of magnitude longer. Occasionally I'll dip in just to get a sense of things, especially if it's struggling with something, or at the opposite end, if it's completely trivial. But I'm hardly reading anything now.

Why? You own the pager, I assume. You own the mental hit when something you let go live (especially with your name on the PR) leaks customer data or deleted someone’s work.

And if you’re not reading your own work, is someone else during the PR? Are you reading other people’s PRs?

How do you know what your product does and how it does it?

From what I understand for most people it isn't a conscious choice, it happens slowly over time. People naturally don't want to waste time, the code is there and if you don't look too closely it works, so they start skimming instead of going in-depth, expecting anything majorly wrong to pop out. But those things probably won't because generated code is very good at looking extremely high quality at a surface level no matter how bad it actually is. So eventually even the skimming starts feeling like a waste of time so it tapers off too.
When the combustion engine was invented, and we got the means by which we could accelerate our trip by 10x, and at the same time scale it to multiple people, we didn't tell the humans to keep pushing the vehicles by their hands, didn't we?
As a developer you are more akin to a car mechanic, who’s still expected to know how the engine works even a century after it was invented, rather than a driver, who is just the user in this parallel.
Mechanics I've been to generally have no idea about how things actually in the car work - from what I could understand, area is full of recurring problems, and this exactly benefits mechanics to solve them through trial and error approach rather than understanding much how underlying things work. Pretty much close to what I would say SWE will turn into, there's no other choice IMO in foreseeable future.
I think you underestimate the skill of more experienced mechanics. Tractor (as in 18 wheeler) and master mechanics tend to know what’s going on under the hood in detail.
I’m sure there are many of those, but like everything, there are tiers. I’m sure we’ll get something similar in SWE, but my hope is that you’ll still be able to choose to be a high tier engineer if you wanted to
Speed doesn't mean anything if you end up driving off a cliff.
Evidence so far does not suggest people driving off a cliff so while a valid concern it's not a likely one. We also acknowledged that the benefit of using a vehicle is such that it outnumbers the risks it may introduce. We never said there will be no risks attached.
We’ve only been on this train for 3-4 years, and in that period, we’ve already invented terms for this kind of vibe-coded, highly-breakable crud. We’ve also had a few, relatively high-profile in their spheres bugs come out and hurt people’s real, lived experiences.

And that’s just the stuff where the house of cards failed quickly.

No, but the US and UK did enact Red Flag laws.
Exactly. That would mean going back to square one, and I also personally don't review the code anymore but I am more focused on asking the model to demonstrate the value it created through benchmarks, workload-generators, and e2e tests.

Mostly it proves as a valid approach, barring the bugs the model can introduce to value-demonstrating benchmarks which can of course skew the evidence on hypotheses, and thus code trajectory the model opts to go with.

The problem I see with this is really that I am not anymore under the control but I am not sure I see other alternative. I am becoming more and more like a system observer with surface-level understanding of the system rather than the engineer with zoomed-in level of understanding of how the code actually behaves. Perhaps we're transitioning into a QA roles present.

Are you working on complex systems that serve many users in production? Do you actually save time?
Yes, I can't say exactly what but the backbone of cloud computing and/or infra, think databases, distributed storage, filesystems, ...
I mean, AWS did just recently go down due to a vibe-coding / agent-run-amuck incident, didn’t it?
I don't know which one exactly but can we now count how many incidents there were in the pre-agent era?
>asking the model to demonstrate the value it created through benchmarks, workload-generators, and e2e tests.

LLMs are fantastic at faking those

> Why are you submitting the code to the git repo like that, with all the wrong text?

According to my enterprise architect I shouldn't be reviewing code, it's a waste of time in this new reality.

I'm still doing it because it's going to be me answering that 3 AM call. But I don't know for how long I'll be allowed to swim upstream like that.

I have found manual reviewing of LLM generated code to be an uphill battle. LLMs does not believe in abstraction. So complexity spills everywhere. Some details in the lowest level might be handled separately in more than one place, at the higher levels. In a short while it is a copiously documented unreadable mess (both code and documentation).

LLM written PR descriptions and comments are a sight to behold. I am not sure how stuff can be written so cryptically. It seems that LLMs just make up what ever terminology so that it can cram as much details into a single sentence as possible! I generally just paste it to chatgpt and ask it to decrypt it.

Yeah, that happens when you vibe code and just let the LLM be in control of everything. If you take responsibility for the architecture and instruct it to do things properly it will do them properly. You can tell it exactly how to do it or you can ask it to handle it in a way that avoids duplication, you can tell it to design a reusable abstraction for this usecase etc.
>If you take responsibility for the architecture and instruct it to do things properly it will do them properly.

The problem here is that after a while it is impossible to detect when such potential abstractions is overlooked in the generated code. Because it has become hard to reason about the existing code.

Not all work is green field.

My personal suspicion is that a lot of preexisting codebases are running on inertia. The abstractions exist and are used well so the generated code also uses it most of the time, with only occasional breaks to the abstraction that look like an acceptable tradeoff in isolation. But those would keep piling up to where the existing abstraction is no longer so identifiable and that's where the major spaghetti code issues start happening.
I have wondered about this. Can’t you ask the AI to find the patterns than need abstracting?
Yes you can. Sometimes it’ll find them, sometimes it won’t.

I find myself having to use Claude to untangle its own mess piece by piece, a as it charged full steam ahead with the design we made together. However, not everything can be foreseen in a design, unless you go full waterfall. Sometimes I find myself in front of a mountain of bad abstractions stemming from a subtle oversight in the design. Before AI coding, I would find details while coding and catch them in time before they became sinful abominations

You can do that, with varying results. Or you can just do actual software engineering like we used to do, and tell it what patterns to abstract and how.

You choose your level of effort and involvement. The LLM can write whatever you tell it to write. If you send a drawing of an app and say "make this" then you'll get whatever it comes up with. If you tell it how to make it then it will make it the way you tell it to.

If your AI code is trash that's because you're trash at directing it.

Yeah - the comments it writes are often "waypoint comments" [1] - great for the LLM during creation but just crap for us - I ask it to remove those before committing.

[1] Not sure if I read that or came up with it.

I believe the general phenomenon is metadiscourse and those in specific are signposting constructions.