
If You Can't Explain It, Don't Ship It: Why You Must Understand AI-Generated Code
AI will not replace engineers. But "I don't know why it works" is no longer an acceptable answer. When code costs almost nothing to generate, the ability to understand AI-generated code becomes the scarce skill, and the thing that separates an engineer from someone who just presses accept.
If you cannot explain it, you cannot own it. If you cannot own it, do not ship it.
Why understanding became the scarce skill
For most of software history, writing code was slow and expensive. Understanding came almost for free, because you built the code line by line. You knew why each piece was there because you put it there.
AI agents flipped this. Now a working feature can appear in minutes. The code compiles, the tests pass and the demo looks good. But nobody on the team may truly know how it works. That is fine right up until it breaks in production at 2 a.m., and the person on call has to debug code they have never really read.
This is also why I do not think AI replaces engineers. I wrote more on that in is it possible for AI to replace you. The job shifts from typing to judging, and judging needs understanding.
The three questions every review should answer
In every review, whether the code came from a person or an agent, you should be able to explain three things.
1. What does this code do?
Not just the happy path. What inputs does it take? What does it return? What side effects does it have, such as writes to a database, calls to an API, or emails sent? If you cannot describe the behaviour in a few plain sentences, you do not understand it yet.
2. Why this approach and not another?
There is almost always more than one way to solve a problem. Why a new table instead of a column? Why a loop instead of a query? Why this library? Agents often pick an approach that works but does not fit your system. Asking "why this?" catches those choices early.
3. What happens when it fails?
This is the question most often skipped. What if the API times out? What if the input is empty, huge or malformed? What if two requests arrive at the same moment? Code that handles failure well is code someone thought about. Code that ignores failure is code someone accepted.
Practical habits that build understanding
You do not need to write every line yourself to understand it. These habits help:
- Ask the agent to explain its diff. Then check the explanation against the code. Gaps between the two are where bugs live.
- Read the tests first. Tests show what the author thought mattered. Missing tests show what they did not think about.
- Run it and break it. Try bad inputs locally. Watch what happens.
- Ask "why" out loud in reviews. Make it normal, not rude, to ask the author to justify a choice.
- Keep changes small. Nobody can deeply understand a 2,000 line diff. Small changes stay understandable.
Where vibe coding fits
There is a place for moving fast without understanding every detail. Prototypes, experiments and throwaway scripts are fine. That is what vibe coding is good for. The line is production. Once real users and real data are involved, someone has to own the code, and ownership means understanding.
How this looks in my workflow
In my own AI native engineering workflow, agents do much of the hands-on writing and testing. My job is to make sure every change that ships is one I can explain. If I cannot answer the three questions above, the change goes back for another pass, no matter how good the demo looks.
A short checklist before you merge
- I can describe what this code does in plain words.
- I know why this approach was chosen.
- I know what happens when it fails.
- The tests cover the important failure cases.
- Someone on the team can support it in production.
The engineers who thrive in the next few years will not be the ones who generate the most code. They will be the ones who understand AI-generated code well enough to stand behind it. If you want help building that culture of ownership in your team, get in touch.
Agree or disagree?
First shared on LinkedIn.
Subscribe to my newsletter
Read articles from Tech With Asim | Learn, Build, Lead directly inside your inbox. Subscribe to the newsletter, and don't miss out.
More Articles

Spec-Driven Development: Why Specs Are Back in the Age of AI Agents
With AI agents doing more of the implementation, the quality of your spec decides the quality of your output. Here is how to practise spec-driven development well.

AI Coding Prompts: Always Tell the Model What Must Not Change
Technically correct, the best kind of correct. AI does exactly what you ask, so good AI coding prompts must say what must not change, not only what to improve.

5 Habits of Great Engineers That Matter More Than Coding Speed
The best engineers I have worked with were not always the fastest coders. Here are the habits of great engineers that turn skill into trust.
Comments