Ask HN: How to deal with shipping AI-written code you don't understand?
630 pointshttps://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?
Comments (767) 238 threads
Show all comments
Showing thread 6 of 238
You must read the code before shipping it to production.
"But I don't have time!" That's not even an excuse. At least one person in your company should be able to explain the code! How would you answer when reviewer asks why did you use this very algorithm?
"We have tests." They could help. But don't rely on them entirely because there's a high possibility that the tests are wrong.
I can't believe how many people proudly admit that they don't read code. I'm not entirely against using LLMs to write or review code, but not even trying to read it should be prohibited. Someone responsible have to review it.
Edit: I know that LLMs are very good at writing code these days. My point is that this is less a matter of quality and more a matter of responsibility.
No you don't. You just need to be reasonably certain it works to specification. That was always the case, with or without LLM generated code. If anything I now have a lot more confidence in some of the code produced because the lower bound has become the LLM.
Releasing something to customers which hasn’t been reviewed by any human is gross negligence.
This is "Preview" — Apple's document viewer on macOS 27. Do you think the testing went well?
Continue this thread — 1 reply
we don't read the assembly code produced by the compiler, nor do we read the code of all open source dependencies, yet we can successfully build software
You have to treat them like an ignorant junior engineer in nearly every respect, but trying to match with them at programming per se is a fool's errand.
The reason to read the code is not because you can catch their errors in programming. It's because they may have missed the forest for the trees at the operational or strategic level, and so that you can learn from them to understand better. It's like trying to beat the engine in chess now.
* As long as it works
Continue this thread — 3 replies
When you actually have to debug, you sometimes need to.
In my products I definitely take care of architecture, interfaces and data, as they have a high cost of failure. Anything else doesn't matter. If an user finds a rare edge condition, asking an agent to fix it costs less than 10€. Properly reviewing a big PR costs somewhere between 100-1.000€. I would be completely irresponsible to my business to review the code in-depth.
But the reason people use real code and frameworks like Django or Rails etc is because it's never just CRUD. You always end up needing some business rule somewhere, or you end with some performance problem leading you to think about async tasks and cached result layers and the like. You need to understand it because you're responsible for giving the correct results to your business and/or customers.
Continue this thread — 1 reply
Continue this thread — 1 reply
The reason is simple. It's extremely morally taxing to read the AI code and realize this is a mess that has to be scrapped.
Much, much more comfortable solution is to join the church of "I don't read code anymore":
1. You can ship fast
2. You can feel good about yourself
3. You avoid facing the uncomfortable truth
4. You get support from fellow believers
Slowing down to review the code feels like drudgery in comparison.
I'm in the review every line camp. I don't trust things that are addictive without a virtuous loop (like exercise). I have to interact with addictive things like video games, loot boxes, gambling, and alcohol in moderation. LLM use fits that perfectly. I'd rather use it throughout the day but still pause and feel the discomfort of reviewing the code, often throwing it out and having it try again when it inevitably makes a hot mess.
Continue this thread — 4 more replies