Top
Best
New

Posted by rzk 13 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?

239 points | 380 commentspage 6
namrog84 6 hours ago|
Im currently building a ui framework for unreal. I dont enjoy ui work so I wanted a way to have to write less ui.

For me I dont look too closely at the implementation but I look at the api where if a human was using my framework how is the code they'd have to write and engage look at. Then I also do plenty of performance against a comparable target in my case slate (default unreal) and keep overhead minimal.

So good performance and reasonable public facing api are the 2 main pieces im focused on. Less with the internals.

Care about the seams and interaction and the things you can measure or count.

exabrial 3 hours ago||
The same rules from 10-20 years ago:

have an architecture

Be consistent. All parts of the app should look like all other parts of the app.

Dont allow clever code

break things into modules

do true unit testing, meaning test the smallest unit of code possible.

torben-friis 6 hours ago||
>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.

"This new way of piling bricks is so fast that I can no longer afford to check the buildings integrity".

I just don't understand how the fuck we ended up with this narrative. Somehow the machine making things twice as fast forbids us from spending time ensuring quality? Surely if it does things faster you have more time and tools to check!

I'm half convinced this frenzy is the marketing work of AI companies at this point.

chrisjj 5 hours ago|
> this frenzy is the marketing work of AI companies

Worse. "AI" is a self-marketing contagious delusion, driven by an inexhaustible power supply. Human gullibility.

_pdp_ 1 hour ago||
I will get downvoted for this comment on this forum but I will call it out.

You wont be able to review or understand code for much longer.

There will be just too much of it. The vastness of code libraries in 5 years are hard to imagine by today's standards.

We need to develop tools that help us understand.

trezm 5 hours ago||
I've been playing with this https://getchronosphere.com. It will (attempt to) rebuild a PR in a coherent journey rather than a massive blob. It's been somewhat helpful up to this point, and still improving.
alpha21io 4 hours ago||
Maybe the new meta should be reviewing new code at the end of the week/month rather than at each merge? But even that might be too much of a bottleneck. The alternative is to talk to your agent to understand changes at a high level without reading every line of code.
realo 3 hours ago||
Maybe a related question:

How do you keep the IEC 62443-4-1 auditors happy?

rubendev 5 hours ago||
I think the solution is leaning on static types and hard to abuse abstractions to make programs correct by construction. It does mean that you’ll still have to use your brain to design the internal code architecture, and just use LLMs to fill in the boring bits between the safe abstractions.
hahn-kev 4 hours ago||
This kinda makes me think about the transition from writing machine code by hand to using a compiler. Did people feel similar at the time that they didn't understand the machine code that the compiler was writing for them?
netburst 3 hours ago||
> ... they didn't understand the machine code that the compiler was writing ...

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!

qayxc 3 hours ago|||
Very good question!

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.

curt15 3 hours ago|||
The key difference is that the procedure for transforming source code -> machine code is fully explainable by anyone with access to the compiler source code. There are no statistical estimations with black-box parameters involved.
Tadpole9181 4 hours ago||
Yes!

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.

netburst 3 hours ago||
While elitism and ego have certainly played a role in the dialog since the beginning of computing, this perspective conflates those issues with the very real technical arguments against the listed technologies. C and other contemporary languages had their limitations; you were sacrificing flexibility and potentially speed for a more pleasant and maintainable development experience. Garbage collection dates from long before the 90s and has always been controversial, in no small part from differing tastes and opinion on whether other memory management techniques are truly more difficult. The assumption that these technologies lowered the barrier to entry may be the crux of much of the argumentation.
jorgeleo 5 hours ago|
Force to always use TTD, at least validate the tests.

Recommend reading (All though a little self serving): https://www.linkedin.com/pulse/ai-code-quality-jorge-varas-a...

More comments...