Top
Best
New

Posted by rzk 15 hours ago

Ask HN: How to deal with shipping AI-written code you don't understand?

I saw this LinkedIn post from a Meta engineer and it resonated with me:

https://www.linkedin.com/posts/ali-hamie_im-an-engineer-at-m...

> I'm an engineer at Meta and I never felt this uncomfortable doing my job. I'm writing code these days and it all feels like a black box. This new standard of shipping with AI is moving so fast that if we're going to spend our time checking each line of code, it's going to take forever. That means you can end up with systems you've built where you don't truly understand how all the code works. You understand the high level, but not every detail. And maybe this is becoming the new standard. It goes against every instinct of being a software engineer. I'm used to understanding what I'm building. Now I'm trying to figure out how much I need to understand before I'm comfortable moving forward. Are other engineers feeling this too?

How are you handling this?

274 points | 413 commentspage 8
vjerancrnjak 6 hours ago|
Formal verification, pick a language that has it integrated and prove relevant post conditions.

AI still does not know how to even write code that makes impossible state unpresentable so testing won’t help.

tkz1312 4 hours ago||
I only ship code I don't understand if it comes with a proof of correctness
netburst 7 hours ago||
It's simple: you don't. You slow down. It's essential to understand what you ship, before you ship, as there are real world consequences for not doing so, ranging from wasting the time and energy of yourself and others, up to failures which cause a great deal of harm to people and the world. To knowingly ship code you don't understand is grossly negligent, regardless of how common it becomes.
lezojeda 6 hours ago|
[dead]
majorchord 7 hours ago||
That's the neat part, you don't.

Or at least, I don't think people should.

To me this completely goes against the whole point of engineering.

IMO If you don't understand the code, then you're just a manager now. Soon your salary may also reflect as such, assuming you get to keep your job.

matltc 7 hours ago||
I don't ship code I don't understand. I fully review every line if it's going to prod.

My dumb little utils in ~/.local/bin? Those get merged after a quick functional test without my having read a single line of it. Still, the skill I maintain for such a job directs agents to write such throwaway scripts in anything but shellscript because I might want to extend some day and fuck shellscript

bpavuk 4 hours ago||
I'd quit. and I did, even before getting my first job that was not an acquaintance's startup, not counting this summer. in fact, I got fired this summer for having called Claude Code "a decent search engine" afther the first two weeks. I fell in love with making code run fast on poor hardware back when I was 8, and now there is a high likelihood that I'll end up a truck driver.

my only response to those who remain and try to control the slop is

  Praise the Omnissiah!
and really, you should have an Imperium/Mechanicus-level devotion (whether it's to money or to AI itself) to survive this and not burn out. in my region, though, you are not getting money - salaries were slashed in half across the board over last two years.

https://t.me/djinni_official/2163 (go in with translator; infographics are in English but explanations are not)

at this point, for a junior, it's easier to find a well-paying blue-collar job than to get into tech, and the ceiling is falling at the speed of sound.

hackerbrother 7 hours ago||
Claude to Prod. Every day.
fnoef 7 hours ago|
Amen. If it works, its good enough.
frumplestlatz 7 hours ago||
The CVEs are going to be epic.
fnoef 7 hours ago||
I don't understand these types of comments. Aren't the CVEs epic today with human written code? What difference does it make then? You want no CVEs, make software engineering into a real gate-kept engineering professions with accountability chains, government regulations, formal education, etc.
akersten 7 hours ago|||
> You want no CVEs, make software engineering into a real gate-kept engineering professions with accountability chains, government regulations, formal education, etc.

This will not only not prevent CVEs, it will also make everything a giant pain in the ass

fnoef 7 hours ago||
Of course it will. But at the same time I don't see building falling left and right like CVEs in software. So don't tell me agents write bad code, because humans do as well. The only way to prevent this (or minimize), is to turn software engineering into real engineering.
ranger_danger 3 hours ago||
The problem is what's happening right now is the opposite of that... software engineers are being turned into managers.

And if you don't think the firings and reduced pay are right around the corner, I have a bridge to sell you.

KaiserPro 6 hours ago||||
By default Claude chooses old versions of libraries. without something that checks for CVEs you're gonna be shipping criticals like no tomorrow.

Yes, there are more CVEs discovered every day, but, if you don't patch, the hacker doesn't have to try.

bigstrat2003 6 hours ago||||
> Aren't the CVEs epic today with human written code? What difference does it make then?

LLMs cause errors at a noticeably higher rate than human devs do. If you lean on them without actually checking what they wrote, the error rate in your software is going to go up.

frumplestlatz 7 hours ago|||
"If it works, ship it" is very different from "If it works, and I understand it because I wrote it, ship it".

Does the LLM understand it, in detail? Can you trust its interpretation of the information and instructions you provided? Did it independently make an adverse decision you haven't noticed, because you didn't read the code? Was the model missing any information it required -- and would you know if it was?

LLMs depend on humans and human oversight to ensure they have the information required to make the right decisions, to catch when they don't, and to steer them based on your much more complete understanding of the broader context and requirements. You can't rely on them to do that thinking for you (yet?).

fnoef 6 hours ago||
I’d argue that most people also don’t understand code they read from their colleagues. Or if they do, then they don’t understand the entire context of the app.

You said LLM need human oversight and it’s true, but it does not imply you have to read the code.

I think we are going towards a place where code no longer makes sense, you just describe what you want in English, and the LLM just builds directly in machine code. You then build different verification tests to make sure the program is doing what it’s suppose to do.

bitbasher 10 hours ago||
> How to deal with shipping AI-written code you don't understand?

Stop shipping code you don't understand.

Is there really any other solution? You can either ignore it and pretend like it's the new era of software like half the other commenters are, or you can sit down and understand the code and what you're shipping.

twelve40 7 hours ago|
I wouldn't be surprised if the meta person has a gun to their head to increasingly keep shipping like a maniac (how decade-long bugs remain unfixed don't ask me), so this advice may not be very useful.
chromak 6 hours ago||
I love using AI, but any feature it creates I test the hell out of it, i become the QA testers I hated and do all sort of ways to break the app, and after 100 or so hours, I have a bug free and fully working app, now will this app scale as I add more features that to be seen.
adamddev1 5 hours ago|
That is the problem. Because it's not a clearly abstracted and well designed system, it's not robust for adding features and changing things around. When you try to add something or move something around the big fragile ball of tests breaks and you have to spend forever re-piecing things together or burning heaps of tokens for little changes.
sunir 4 hours ago|
I'm building a high level code explorer, like the CASE systems of a long time ago I suppose. I also built a facility called zork that lets me and an agent explore the code system together like a dungeon, taking notes as I go and if you want to take the metaphor too far, 'invoking spells' or rather commands like code references, call flow, data flow, exception flow, profiling, labelling design patterns and validating implementation, etc.

With zork I can also just start typing in a code file and leave instructions for the agent to fill in or fix parts of the code while I'm editing it. So I can lay out what I want the class shape to be and don't have to implement all the annoying little parts. This feels more like the GitHub Copilot days.

I honestly believe more of us will pair program with agents, not just yelling at a chat window.

More comments...