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 10 of 238
For my part: I've put some of my tooling energy into code comprehension tools. You can get remarkably far quickly by just replacing the Github PR viewer! I started with a (native SwiftUI) read-only front end for tree-sitter and SCIP (the code-indexing standard). Then: as I reviewed PRs, I tried to catch myself doing annoying repetitive things and just building out additional features, like "show me all the knowable call chains for this function", or "show me every implementation of this trait".
You can get a fair ways just by thinking of things to hide in a PR viewer, just to clear space for the things you need to comprehend.
That's really it. I've been finding the same limitations with the default PR code review tools. We currently make do by having a section in our PRs "recommended review order" with a list of files/dirs that should be looked at first, which not only is much smaller Loc than everything else but is the main relevance of the PR.
Within a given project there are inevitably certain files/concepts that are more important, and a better review tool will help emphasize the structure of a large PR to make things easier to review.
I suppose you created a web based front end to GitHub PRs for your team to use? Or is it a local tool? Wondering how yours works.
We use gitlab and there's probably some way to hook up a custom external review tool easily (a bot that posts a link to view the current PR in the tool, for example)
Thanks for the idea!
The key thing, for me, is just having an app that is useful enough to keep running. I get ideas on how to streamline and improve review as I do it (for instance: double click on a symbol to highlight it throughout the rest of the function so I can trace assignments and expressions). Five years ago, implementing these random ideas would be too expensive; I'd lose several hours to each of them. Now it's just: have a dumb idea, share the dumb idea with the agent managing my app, check back in in 10 minutes, and now my review app is better.
It's very much like working in Emacs, but for everything.