DEV Community

Dimitris Kyrkos
Dimitris Kyrkos

Posted on

Using AI to Code Isn't the Risk. Not Understanding What It Shipped Is

Intro

There's a gap between the way AI-assisted coding gets demoed and the way it actually gets used under a deadline. In the demo, the model writes a function, the developer reads it, understands it, and merges it. Under a deadline, the model writes a function, the developer skims it, it looks plausible, and it merges. Same tool, two completely different outcomes, and the difference isn't visible in the diff.

Call the first one cognitive assistance: the AI removes typing, not thinking. Call the second one cognitive offloading: the AI removes thinking, and the developer just does the typing that's left, mostly pressing "accept." Both look identical in a pull request. They only diverge later, when something breaks and someone has to explain why the system does what it does.

Here's where that gap actually shows up in production. (Illustrative composites drawn from common patterns, not specific incidents.)

The schema nobody actually reasoned about

A developer asks an AI assistant to generate a migration adding a new table with two foreign keys. It looks right, it runs locally, tests pass, it ships. Nobody on the team, including the person who wrote the migration, actually worked through the access pattern the new table would see in production. Three months later, a dashboard query against that table starts timing out under real traffic, because there's no index on the column it's actually filtered by, a detail that would have been obvious to anyone who'd designed the schema by hand instead of approving one.

The stack trace that got forwarded, not read

Someone hits a NullPointerException, pastes the trace into an AI chat, gets back a suggested null check, adds it, ships it. The exception stops. Two sprints later, a related bug shows up somewhere downstream, because the null check treated a symptom, a race condition further up the call stack, not the cause. Nobody connects the two, because nobody who touched the first fix ever understood what was actually racing.

The architecture nobody in the room can defend

In a retro, a tech lead asks why a service makes three synchronous calls to downstream services instead of publishing to a queue. Nobody has an answer, because the pattern was generated during a crunch week, skimmed, and merged. It's not that the pattern is necessarily wrong, it's that no one currently on the team could tell you whether it's wrong, which means no one can safely change it either.

Cognitive offloading isn't really an AI problem. It's a code review discipline problem wearing an AI hat. Teams that had weak review habits before AI tools now get weak review at a much higher volume and velocity, which turns a slow leak into a flood.

A quick gut check, if you want one: before you merge AI-generated code, can you explain it to a teammate without opening the chat history again? Could you have arrived at this approach yourself given more time? Do you know why this pattern and not an obvious alternative? If the honest answer to any of those is no, that's not a blocker, it's just useful information about which side of the line you're currently standing on.

Where do you draw the line between assistance and offloading on your team, is it an explicit rule, part of your review process, or just a gut feeling that kicks in after something's already gone wrong?

Top comments (1)

Collapse
 
hoseinmdev profile image
Hosein Mahmoudi

Spot on! That distinction between cognitive assistance vs cognitive offloading is the cleanest way I've seen it framed.

The 'can you explain it without checking the AI chat history' is such a solid gut check before merging. Great write-up!