Ask HN: How to deal with shipping AI-written code you don't understand?
463 points by rzk a day ago
463 points by rzk a day ago
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?
I’m surprised I haven’t see anyone say this yet, but I don’t let the LLM design the code at all, I let it implement a design I have created. By that I mean that, rather than let the LLM do the entire structure, I take the time to create the full hierarchy of abstractions and actors that I want my code to do. I decide, at the UML level, how abstractions will sit and interact — and then I make the LLM implement those gaps. The key thing here is that, by doing this, I DO know how the code works. I may not know how each unit is implemented, but I know each unit’s responsibilities and how they interact with one another. I’ve found that LLMs are HORRIBLE at writing decent abstractions, regardless of how much prompting and skills I’ve given it. It will always get the job done, but it will often be unmaintainable and require bigger and heavier refactors as I introduce more and more requirement changes. But by flexing my basic design skills, I don’t have those issues. Future refactoring fit into easy abstractions that I’ve designed. And by documenting it up front, I also have what becomes a living document on how this work will turn out. It takes a few hours up front to plan ahead, but it makes the LLMs job easier and use less tokens, and it makes the code better long term. I don’t care if one unit is suboptimal, as long as the abstraction is right — because at worst I can change an implementation for a better one later. A friend of mine sometimes jokes that code is “fractally busted” when it’s wrong at every level, from single lines all the way up to the design of the system’s main interfaces. That’s also roughly what I find after a long English-only session with a coding agent. Our conversation covers a lot of ground... and leaves out details at every level. When I look at what got built, the misunderstandings are fractal too. I agree it’s important to design it yourself, but UML is only one level. Lately I’ve been using a scratch Python file (or even a scratch repo) that Claude and I both edit. Never mind that I’m writing Rust. Python reads like pseudocode, and pass and ... (Ellipsis) let me skip whatever I don’t care about. At any level where I do care, I can say exactly what a method’s signature should look like, what fields a domain model should have, or how it should maintain key invariants. Everywhere else I leave an ellipsis, maybe a docstring, and let the agent decide. It works both ways: I ask the agent to sketch the current system in Python, with some details elided and others spelled out. Then I edit the sketch and have the agent push the changes back into the much bigger Rust+Tauri app. Time will tell whether this approach has legs, but when I want to be precise, I find it sometimes pays to just write some code. I've found that current models will almost automatically sketch out some things in Python (or another suitable language for the type of task, or an implementation language you've already stipulated) while proposing a design, and you can go through a conversation of "what if we did xyz instead?" and at some point "okay, let's try writing a full prototype" (perhaps tacking on a bunch of decisions here so that things are resolved enough to work with). But that's at the scale of <1kloc. Might be different if you're trying to do a bigger feature all at once. This is the way. I can write pseudo code (ie Python) and I leave a breadcrumb trail of comments where I want it to implement. Hell the code doesn’t even need to have valid syntax if you forgot some function signature, but that small amount of guiding can produce significantly better results than a blind implementation from the model. I’ve also tried spending an hour or two first before handing over control. That way there’s something pre-existing it can work from. I agree with this approach, but I'm a bit surprised this has to be said at all. These are basic software design principles and I imagine it's the default way any experienced programmer would approach the problem. I wonder if the people not using this approach are primarily junior developers who have never seen how real software is built, or if it's leaking into the senior levels as well. Most people in the industry right now, even at FAANG and even among people carrying "senior" titles at these places, have little experience with "software design principles" -- tens of thousands of brilliant Ivy League graduates with surreal compensation packages have spent the last decade pulling tickets off JIRA and pasting least-change-possible patches onto existing code for about 10 hours a week while spending the other 30+ hours barely engaged at meetings. This is maddening. I've been pulling 40/50/60 hour weeks for 21 years in the tech industry at various different companies. I haven't broken 200k base salary, though benefits are pretty great where I'm at. To think I could've memorized some leet code problems, got a job at FAANG and been making 300k base for the past 5+ years while working 10-hour weeks is - yep, maddening. Don't feel bad. It is not about skill in those job, it is about "cultural fit". You must project a personality that will fit in with FAANG culture or you won't get the job unless you're famous globally due to having starting some huge open source project. Comfort yourself with the fact that you did not have to sell your soul, sit through endless woke sexual harassment videos where you are taught that the white man is the source of all evil, and in endless management meetings. Did you go to Stanford or a similar pedigreed college? Unless you did that or broke that 200k barrier already by getting high up in a lower tier company, just memorizing some leet code problems wasn’t going to get you into a FAANG. They care a lot about prestige. Or at least did before AI. Don’t know what their current hiring practices look like. There are plenty of people who did all of this at FAANG and never have even heard of leetcode, let alone solved a problem. This hurt to read but checks out in my experience. These types also tend to love tossing debt over silo'd walls and pointing the finger a lot if/when anything goes wrong. I'm old enough now to be a protected class, so I don't want people accusing me of ageism, because that's not where this is coming from - but there's a type of person that clearly is on their last job of their career and knows it and I try to avoid them like the plague, I've seen it too many times. The 30+ hours were often just goofing off/video games/porn, very few are in 30 hours of meetings. The amount of grift, non-work, fake work, etc that remote well paid tech workers get to do is absurd. The incentive structures are all fucked up. It's far more profitable for all parties involved to just slop out some barely maintainable bullshit that only just meets the product manager's criteria for external quality while completely neglecting the internal quality of the software [0]. By the time the system starts to experience strain under the weight of its technical debt two years later, the original tech lead/architect of the project has already added it to his resume as another bullet point, found a new job at 20% higher comp, and no longer has to ever look at that code, ever again. Now it's the next asshole's problem. Good luck! [0] Freeman & Pryce 2009 for the "internal quality" vs. "external quality" dichotomy I think part of the problem is the original product manager has also added this as a bullet point on their resume and gotten promoted. They get to watch the dumpster fire from a safe distance. I work on my code this way, but I have no idea what my colleagues are doing, and it's impossible to review thousands of new/changed lines a week. I just approve PRs, because I have to. I don't know what else to do. I can barely keep an eye on all my code. Actively looking, but job market is rough in Northern Europe. I quit caring about quality in any capacity here, the company has clearly chosen its direction, against my very vocal complaints. My last interview, with what I thought was a great company, failed when I didn't understand what NLP was when they asked me about it. > NLP?
> Natural Language Programming, it's the future. Claude, GPT, etc. I laughed, he didn't, looked offended and said it was a serious question. I had thought it was a joke, said "oh you mean LLMs". I tried to answer seriously, of course, but that was my third round technical interview and I didn't get a call back. Just getting a paycheck and producing mediocre work until I get something new. (Senior engineer, 10 YOE, patents, 3 years at a unicorn). Also considering becoming an electrician. I will be unhappy if they steal the meaning of NLP. NLP means Natural Language Processing and LLMs are only a subset of NLP. I would have concerns about anyone who claims to have technical knowledge and asserts NLP means "natural language programming." Those are the same kind of people who might suggest Lisp should add mutable objects. You may be surprised and annoyed that NLP is also "Neuro linguistic programming", I've met technical people talking of NLP and meaning that... Yes, but that's in psychology. Different fields have their own terms without causing too many issues. Communication breaks down when we reuse terms for different things within the same field. >Communication breaks down when we reuse terms for different things within the same field. Ahem Maybe you should write a shim for the stack you're using to broker domains. They're not unrelated, though. Without massive scale weapon-grade NLP coming out of AI PR depts and targeting unwitting programmers, the LLM psychosis wouldn't happen. I'm in what I think will be my last tech job before retraining into something else. The aspects I like about the work are gone, I'm coasting at a small company that's not a great fit, has a visa cliff, and is poorly paid, and the steps it would take to become competitive in an LLM driven tech job market are less appealing to me than the steps it would take to switch over to a different career (likely in healthcare). Good luck! I took the plunge last year and am just finishing up med school pre-requisites. I'd say at least 6/30 of my O Chem II class are former software engineers. Thank you! I'm still in a very exploratory phase about what exactly I mean by switching into healthcare. I don't have prereqs done at all, and my current plan is to enroll in a second bachelor's next year and start working through bio and chem courses. I'm looking at a bunch of different options from nursing to PA school to medical physics, and I think I really need to start shadowing people in different professions. Med school interests me, but I'm a woman in my late 20s who would like to have children, and if I started down the med school road now I wouldn't be done with training until my late 30s, where PA and nursing school don't have that problem. Medical physics is kind of in the middle. Oh interesting. I was looking at bio-informatics briefly but never even considered medical physics. It's crazy just how big healthcare is and how ignorant I was to it prior to making the transition. Would agree that shadowing has a huge impact on determining what you want to do in the future. My cousin went the PA route over med school and honestly I think it's the best from an ROI and free-time perspective. In her early 30's now and every other weekend she's in a different country. Understand completely. I'm a little older than you but the high chance of giving up a family was the first thing on the negative column when I was deciding paths. Awesome! I'm taking prerequisite classes (probably for Physician's Assistant school) while picking up a few shifts at the local EMS station. Good luck on your journey! literally in the same boat, gonna see if i can't use ai to build some products to make money and help people, or else i'll go into healthcare and make (significantly less) money and help people. If that's what NLP stands for now then I want off. You will get used to it. Even I accepted cyber eventually and now no one bats an eye. Yeah, I imagine it's something that needs to be enforced at the organizational level. I sympathize with anyone who takes pride in their work and needs to deal with mindless coworkers pushing slop without any accountability. I left corporate software development (before LLMs were a thing) over frustration with the general culture and I can only imagine it's gotten worse since then. It's really bad now, yeah. :( It just really hurts that I spent well over a decade of my life learning and honing skills to engineer safe, quality software and now it's just, useless. No one cares at best, or I'm callously told "keep up or fall behind" at worst. When that's not even the problem, it just, sucks now. There's no joy in anything I do professionally. Can I ask where you went? I'm seriously looking for an exit, I just don't know what yet. Maybe a trade, in Scandinavia the pay is actually comparable, I just don't want to go back to school. It just really hurts that I spent well over a decade of my life learning and honing skills to engineer safe, quality software and now it's just, useless. It can feel that way with all the hype but I very much doubt that is really true. I see an industry that is rapidly dividing into two camps - "move fast and break things" and "this actually needs to work". Writing everything with agents and merging while barely even checking what is in the PR has become standard practice in the former but it will get you laughed out of the room in the latter. Even “actually needs to work” has a wide spectrum from “people could die” to “our customers will be pissed”. For the latter, the product looks nice and polished on the outside but makes “steaming pile of crap” a gross understatement. I was fortunate and saved up enough to live frugally and just work on passion/learning projects for a while. I've been considering going back into commercial software development as a solo dev and leveraging AI, but keeping the focus on quality and craftsmanship. In my opinion there's never been a better time to start a new, ambitious project if you're passionate about quality software. I agree, that's acutally what I'm doing right now: living frugally in a cheap country while building an ambitious high quality pruduct. I never had a better time "professionally" (albeit no income yet!) so far in my whole life! Apparently it's truly like the best of times and the worst of times to be building software, if you have the luck and the luxury to be able to work only for yourself than it's really a great time to be alive. Sounds like a cushy job. Why would you want to leave? Some people just can't turn off their brains and play drone for dozens of hours a week for decades. It feels existentially, aesthetically, and sometimes ethically crushing to spend a whole life doing work you can't expect yourself to respect or value, no matter how much you get paid or how little the work overtly demands of you. Often, the lack of meaningfully challenging demands being put on you is punishing on its own. It can feel like a relief for a week or month or year, but if you catch a glimpse of that being your whole future, you can come to recognize yourself as being in a mind-eroding secular purgatory. This anguish is especially common among on highly capable people, high achievers, and those used to some kind of ambition. And by accident of its history, there's a lot of those people in this industry and some of them are going nuts now. > and some of them are going nuts now. Pretty much this. I know it sounds melodramatic but it literally feels like rotting. I don't solve anything anymore. I don't get any spark of fixing bugs. I don't DO ANYTHING, and it's fucking chipping away at me. Also I'm fairly sure people are going to realise soon that if they're happy with slop, they don't actually need highly trained engineers anymore. This whole thread actually prompted me to look into electrician work, especially in renewables that we have here in Norway. I might fix my burnout and go to school to get my 2 year qualification. AI can't rewire a hydro dam. Man, I have the same feeling.
A long time in your life you build the career and now it’s just feeling so empty, like you are not a engineer anymore, now everyone can use AI and without checking code they would have good results. > now everyone can use AI and without checking code they would have good results ?!!? No way. Are you sure? What kind of work? Here there’s still a lot of care needed to navigate the LLM work, like knowing when to make it quit, rewrite, refactor, follow your outline. It feels magic but when I watch people who don’t know what they are doing trying to make something new (not almost a clone of an existing product), they get pretty frustrated. I once lost out on 3 months severance and a laptop when I quit a place and they shuttered two and a half weeks later. There had been no direction from the top for over a month other than "ehh, do something useful". I was working remotely and slowly going crazy. > This anguish is especially common among on highly capable people, high achievers, and those used to some kind of ambition. And by accident of its history, there's a lot of those people in this industry and some of them are going nuts now. I went nuts for years, until I sold off my interest in my dream partnership. 10 years of heaven. All the benefits and none of the downsides of my internal colleagues. Then 14 years of bureaucracy aimed at predictability over progress, which was infinitely more difficult for me to dodge as an external player. Compensation for my interest was very objectively valued, with the rate of stalled progress priced in. Which made complete sense, while also being its own madness. I walked away from so much value, but I don't regret it for a minute. This exact mentality is extremely toxic and is why the historical "anti-work" movements (i.e. Anarchists) have been kneecapped, often by their supposed best friends (i.e. Commies). The major disagreement circa the 2nd internationale was "is work good, but bad that you're exploited and not paid well?" (the Marxist view) vs "Work fucking sucks and we should abolish it" (The Anarchist view) https://en.wikipedia.org/wiki/The_Right_to_Be_Lazy https://en.wikipedia.org/wiki/In_Praise_of_Idleness_and_Othe... I can't believe how much mental justification needs to be made by otherwise highly intelligent people (Bertrand Russel wrote In Praise of Idleness) to defend the right to not work. No, I fully reject any notion of life value coming from work, and those who hold your view are basically jailors to those who don't want our identity defined by work. That's not how the world works, and I don't need this in a thread where I'm dealing with the grief of a good career. Please shove off. I would gladly not work and learn cello and physics independently if that were a real possibility, but it's not, and it won't be within my lifetime. I had a job in a system that required jobs to survive that genuinely didn't bother me. I actually quite enjoyed it most of the time. Now it's permanently dead and I need something else, or I am homeless and starve to death. > No, I fully reject any notion of life value coming from work, and those who hold your view are basically jailors to those who don't want our identity defined by work. Fuck off. I'd forgotten why I'd stopped commenting here. Thanks for reminding me, everyone. The LLMs know design principles too, being an experienced developer doesn't make you as special as you might think. Don't get me wrong, LLMs are way better than me at most things, but I don't think you can deny that the current generation of models makes questionable decisions sometimes. Especially on project structure, API boundaries, and code duplication. I also think they just have bad taste in general, though of course that's more subjective. I’m not sure how to say this without sounding smug, but the last year has shown that most of those things just… don’t matter. It’s just the next level of the “variable naming PR comment battle”, so will become obsolete very soon. Obviously there are mission critical systems where it matters, but if “your code can be A/B tested” or “slowly rolled out”, chances are, it doesn’t matter. You'll find that design matters when token spend starts facing real accounting. Tech debt is still tech debt, even if there exist models that can wade through, because it's going to require increasingly sophisticated models navigating increasingly large context windows and increasingly speculative workspace operations to keep making progress on it. Vendors like Anthropic and OpenAI are laying a pit trap when they demonstrate how their models can independently code their whole platform as it becomes increasingly byzantine and inscrutable because not only do they benefit from internal/prerelease models but they have effectively unlimited spend because all that spending acts as a lure to draw you into their trap. For everybody else, design still matters. People are just working really hard to make you forget. Personally I think I could probably be content for the rest of my days running something like Z.ai glm-5.3-flash locally, so I'm not that worried about the token spending (and still can't understand how OAI/Anthropic/etc convinced the market they have any kind of moat to motivate those kind of evaluations, but that's another topic...) That said, I also feel like betting on readability, maintainablility, taste, etc, being an important aspect of software, at least until code will remain some sort of human readable artifact. We'll still want to be able to understand it and perhaps occasionally add/edit by hand, make sense of it without trusting blindly what any kind of program (LLM based or not) will tell us about it, and so on. The problem here is not the vendors.
The "problem" is that design mattered when producing code was a truly manual effort. Writing things down, aligning specs, design, contracts, all of that would mold what could come next.
Now ANY design from amazing to terrible can be regenerated and generated dozens of times over for literal single digit dollars. Cost of tokens is NOT a problem unless you have a codebase with hundreds of person-years of effort. Not many people do. Honestly, I keep hearing this argument, but the past 2 years have shown the opposite. OAI/Ant are not the only companies providing inference. There are legitimate FAANG-like companies that have general guidelines about “when to use Fable/GLM/DS” and etc. to keep the costs down. And I think it’ll continue that way. You didn't address the argument about tech debt. How do you get the greatest quantity of maintainable, high quality code within a given token budget? The answer, at least so far, seems to be human experts in the loop. We've also been hearing for years that LLMs are going to automate away software development entirely, but software job postings are steadily rising. https://www.cnbc.com/2026/10/11/ai-software-developer-jobs.h... >How do you get the greatest quantity of maintainable, high quality code within a given token budget? Doesn't matter as much. The cost of "maintenance" is going down, from what I can see internally, from other companies, and every story i'm reading from other organizations as well. Token budgets are changing, but model quality and effectiveness are going up as well. > We've also been hearing for years that LLMs are going to automate away software development entirely, but software job postings are steadily rising. I think this has been contested from day 1. SE jobs might be automated, but jobs might increase, if there's possibility of starting new companies / new investments / etc.
bitwizeshift - 14 hours ago
davepeck - 7 hours ago
zahlman - 2 hours ago
throwaway219450 - 6 hours ago
fasterik - 14 hours ago
swatcoder - 14 hours ago
WesleyJohnson - 6 hours ago
abc123abc123 - an hour ago
lovich - 2 hours ago
Der_Einzige - 6 hours ago
JohnMakin - 13 hours ago
Der_Einzige - 6 hours ago
rdevilla - 12 hours ago
BobbyTables2 - 7 hours ago
birdsongs - 14 hours ago
hathawsh - 13 hours ago
riffraff - 13 hours ago
hathawsh - 13 hours ago
aa-jv - 10 minutes ago
wartywhoa23 - 3 hours ago
annzabelle - 12 hours ago
Fantosism - 12 hours ago
annzabelle - 11 hours ago
Fantosism - 10 hours ago
richiebful1 - 9 hours ago
slopinthebag - 11 hours ago
senderista - 7 hours ago
iugtmkbdfil834 - 4 hours ago
fasterik - 14 hours ago
birdsongs - 13 hours ago
Silhouette - 13 hours ago
BobbyTables2 - 7 hours ago
fasterik - 13 hours ago
alexfortin - 9 hours ago
fluoridation - 14 hours ago
swatcoder - 13 hours ago
birdsongs - 13 hours ago
tomat_1000 - 13 hours ago
fn-mote - 10 hours ago
a_t48 - 11 hours ago
Nevermark - 13 hours ago
Der_Einzige - 5 hours ago
birdsongs - 2 hours ago
fluoridation - 11 hours ago
trio8453 - 14 hours ago
fasterik - 14 hours ago
tokioyoyo - 13 hours ago
swatcoder - 13 hours ago
alexfortin - 3 hours ago
brunooliv - 3 hours ago
tokioyoyo - 12 hours ago
fasterik - 11 hours ago
tokioyoyo - 10 hours ago