2 min read

Blame It On AI?

"Shit, AI 🙈", "Ah, fuckin co-pilot 🤦".

Lately, I can't keep count of the number of times I've seen such comments on GitHub pull request conversations.

The story is familiar:
  • Developer opens a pull request, coded with some AI assistance
  • A reviewer points out mistakes in the code
  • Then the developer blames the AI tool.
(I have been guilty of such too.)

AI has undeniably made life easier for so many. And for programmers, it has been an incredible assistant and a productivity booster. From brainstorming solutions to problems, to providing answers to questions faster than Google or Stack Overflow, to actually building full-blown, working applications from scratch with only a few lines of prompt. The benefits are indisputable.

Many companies now invest generously in AI tools for their tech team. Some even require developers to work with the help of some AI tool.

The dependence on AI for programming has grown over the years, and will keep growing (see this Stack Overflow survey). It is now common for developers to implement features without typing a single line of code; the AI agent codes everything with some human guidance via prompts. 

But this introduces a problem.

AI isn't perfect. Sometimes it hallucinates, gives outrightly wrong answers, makes costly mistakes; just like humans, you might say. But there’s a difference.

When you write code, you engage in deliberate thinking and maintain awareness of what you're writing.
This conscious engagement often leads to an informal, subconscious form of self-review in the process. So by the time the feature is complete, or you open a pull request, you are conscious of every piece of code in it. Yes, there might be mistakes or issues, but when they're identified, they're easily understood and fixed.

But when most of the coding is delegated to AI, that awareness is diminished and the subconscious self-review is mostly eliminated. You could guide the AI through prompting, and the general approach and idea might be yours, but it's still not the same as writing code yourself.

I think it's okay to delegate most of the coding to AI in many cases, e.g. boilerplate, repetitive code. However, the onus is on the code author to review AI-generated code thoroughly before requesting a review from a colleague. Even for code written by a human, a conscious self-review is necessary after implementation. For AI-generated code, it is crucial. I think it is irresponsible and disrespectful to ask for a review without doing a thorough self-review, and even more irresponsible to blame mistakes on AI. 

Regardless of the amount of AI involvement, you the developer owns the code, so you should own all mistakes, including those introduced by AI.

So next time someone points out a mistake, don’t blame it on AI!

Thanks for reading! Have thoughts or questions?

More articles