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
Earlier commentsUnfortunately the answer is that you better get comfortable with the feeling and know that when something goes wrong it's not the end of the world (for most of us, some of the AI labs it may actually be) and while it will be painful you fight through the incident, you do the post mortem and you don't let that class of error happen again.
There are some techniques, which you hated as an IC that you'll now have to embrace:
1. Have it write a doc and review it.
2. Have a strong point of view on critical parts of the architecture and one way doors. Review those mercilessly.
3. Spot check and taste test the code.
4. Be merciless about the small mistakes you see slipping in expand scope on them to find the class of problem it is.
5. Think about contracts and test coverage and failure modes at a higher level. What is the most effective way to find misalignment without reviewing every line.
Know that through this meta process you will squeeze out risk but that you won't eliminate it and at some point you feel like you squeezed out enough risk to ship.
And when something does go wrong take that moment to find a way to add another step to your risk reduction process that eliminates that class of errors not just that individual error.
Each step in abstraction we've made had people who felt uncomfortable at the level of magic they were accepting. At one point in the 70s/80s, traditionalists were arguing that C itself was too high level. Then in the 90s and early 00s, that languages like Python and garbage collection were absurd: a "good" programmer doesn't need them and they give up too much control. Then as web development ramped up, people entered the "Javascript is slop" phase into "React is slop" phase.
Anytime the barrier to entry is reduced and some skill or profession becomes more focused on output than the ego of the professionals, you can bet a counter-culture of people will rise up to oppose it. It's a threat to their sense of "betterness" and/or the (perceived) value of their career.
Looklike they are correct because now we have web people making 1GB-RAM Weather app.
This is a bold assumption and inconsistent with my knowledge of history. High level languages allowed better management of complexity and reduction of tedium. The common complaint was that compilers produced less efficient (slower and/or larger) code, not that the output was more complex. It was[1] normal to read the compiler's output, which was generally assembly or another intermediate representation. After all, a compiler is merely a tool for translation from one language to another. Additionally, early compilers often were not optimizing compilers; the code they generated was simpler than handwritten programs.
1: And still is, for some of us!
The problem assembly programmers had with compilers wasn't that they wouldn't understand the generated machine code - it was that the generated code was often bad (as in unoptimized and bloated) and didn't justify the resources required to run the compiler. As hardware got more complex and powerful, compiler got much better, and operating systems became the primary layer between hardware and applications, assembly became more niche. Nowadays it's pretty challenging to beat the compiler at generating efficient assembly and writing a program in assembly would consist primarily of OS and library API calls anyway.
There are definitely parallels there. The only obvious difference I can see is that both high level language code and assembly are unequivocal in their meaning (as in you can determine what gets executed), whereas natural language is not.
All comments shown.
Couldn't load more comments. Check your connection and try again.