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 2 of 238
With AI, everyone now gets to act like a PE. Your job is to design, the AI builds like the junior engineers. Then you review their work. You may never understand the details, and that's ok, as long as you know the main ideas and where to ask for the details (in this case the LLM instead of a human).
As engineers our job is to solve problems at various levels of abstraction. Developers that think we are just automating away our own jobs have missed the point. It's not about writing the code anymore, it's about designing solutions to problems and distilling that to agents in a way that achieves the outcome you wanted. Models are not good at coming up with this direction on their own, nor are they good at designing cohesive user experiences across a plane of complexity. These two areas require most of my time now while actually writing the code has been delegated away.
Or maybe keep manual coding to build confidence, so that one can say "I've done that before..." and be able defend or take apart a particular strategy.
But you never heard someone say "you should still code in assembly so you can understand what your compiler is doing".
Is this more like case one or case two? Will it matter if you understand in a few years?
It’s perhaps important to learn the consequences of certain design and impl details? Because Sonnet-class models can often miss these more easily than Fable-class.
That said, refactoring and bug-fixing is faster than ever. So I’d argue LLM coding is actually quite a bit different than having a compiler. In ways we’re still seeing ?
i spent a few weeks coding assembly at the beginning of my career. really enjoyed it and feel like it helped me understand CPUs a lot better. i'd still recommend it to early career engineers
You should only have a high-level understanding and be able to orchestrate things, plan, and make choices. AI do the details.
Any quality CS program will have you do that for a year or so, plus theory.
Continue this thread — 3 replies
It's also a lot of fun to do on tiny 8 bit microcontrollers like the AVR. It's really neat to be able to understand exactly how many clock cycles some code will use. This came in super handy for me once when I wrote a small bit-banging serial interface and had to debug why some characters would randomly be wrong.
Would I routinely code in assembly today? Not for (almost) any new project.
Can I understand assembly and have I used that skill to understand performance problems or debug unexpected behaviour (including some that really did turn out to be caused by bugs in popular compilers)? Absolutely.
I'm not generally a fan of the comparison between what LLMs do and what compilers do. Compilers might vary in their output for given source code but they still follow (hopefully) well-defined specifications. Their behaviour is deterministic and the behaviour of their output is deterministic. With sufficient understanding you can reason about that output or diagnose faults in the compiler behaviour if you ever need to. None of this is true for LLMs.
Continue this thread — 14 replies
Stop drinking the cool aid and compare compilers with ai models.
I don't think llms are an abstraction - they're a delegation.
Advice about a homelab might be more more common since it's more practical. I'd also value the opportunities it presents for general experience. For example when running a homelab you're organizing and putting together systems, or maybe balancing resource management and budgeting to find the right hardware.
The specific details probably won't matter in the long run (except maybe during a certain flavor of trivia night). But I think having some knowledge about what came before helps build intuition about how new things are put together, which makes a lot of tech look less like magic and more personally achievable.
That's true but a similar advice that is given to junior developers in their early career is to actually reinvent the wheel, so that they can learn from the pain and then rip the profits of using reusable components. That's unvaluable. You have to read through thousands of lines of code and write some more yourself to get good at programming.
I liked working with people. It's a lonely road ahead.
I've heard this before many times, and it's simply not true. The resemblance is there, but there's also a fundamental difference. The difference is in whose name is on the commit, who embraces responsibility for things going wrong. PE will, at most, share responsibility with the person who actually authored the code, AI user is always responsible for whatever code their agent wrote.
As a PE you may skip reading all the code written by your underlings because your underlings have signed a contract with your employer and will be legally responsible for certain things, have they decided to do those.
In the case of actual PE, there's an actual programmer who, at least, believes he or she understands the code they wrote. In the case of AI, there maybe nobody.
Here's an interesting aspect though. There are companies (I'd know, since I worked for one), who sell a product where there's a part of code no engineer working for that company understands. In my case, that piece of code was a formula obtained from some former partner (a bank) to calculate something related to credit check. Nobody could explain why the formula was the way it was, but it was extensively used in testing to validate that our code produced the intended result when it came to this part of credit check. There's a folk tale about DB2 containing a binary blob whose source was likely written in Assembly and was since lost to time, which is essentially a magic component nobody really knows the internal workings of. I'm sure there are more pieces like that around in older companies.
Since I expect the regulators will soon start tightening the nuts on programming in general, especially since AI is asking for such an action, what will happen to these "magic" programs? If I were a regulator, I would have the company, under a threat of criminal punishment in some cases, to vow that they understand the code that went into making of their product and are therefore responsible for what it does. This is not the case today and only in a very few cases were software companies found guilty of criminal negligence... but I think that the writing is on the wall: with AI being used the way it is, the legislation requiring understanding is just around the corner.
1. How to develop Principal Engineer skills? Designing and communicating the design correctly is not straightforward.
2. Are we sure this approach works better? Current AI systems are very good at solving problems and SW because of the Reinforcement Learning they went through. I suspect they perform better when doing things their own way. Forcing them to change to an arbitrary workflow may confuse them and reduce performance instead of enhancing it.
Second one is a version of the "Bitter Lesson" adapted to SWE.
I'll add to this that your job is also to design tooling and feedback loops that allows the AI to improve over time.
You have policy gates: How the AI should act. (and a feedback loop to check the code is adhering to those policy gates)
You have quality gates: How the AI verifies it's done things correctly (testing, linting, PRDs, cyclomatic complexity)
Modern AI engineering is really about improving this system rather than manually reviewing AI output. The better the policy gate and quality gate enforcement, the less manual review is required and the more velocity you achieve.
Sticking with being a human-in-the-loop reviewer of AI code is where people lose all hope in still being software engineers.