Now we can write crappy code, AI will understand it anyway! | Nexely
It seems like we hear this idea more and more often: “Why spend time on architecture? The AI agent can find the right file, understand the logic, and fix eve...
It seems like we hear this idea more and more often: “Why spend time on architecture? The AI agent can find the right file, understand the logic, and fix everything by itself.” It sounds reasonable. But a study by SonarSource (I can send link on this news) shows an interesting detail: AI can actually handle bad code… but that doesn’t mean it doesn’t care about it. The researchers created a pretty clever experiment. They took pairs of repositories: one version was “clean”: good structure, clear names, and lower complexity; the second one looked like a typical project after years without refactoring: large classes, deep nesting, and many code quality issues. At the same time, the behavior of both applications was exactly the same: the same dependencies, the same tests, and the same results. Then they gave these projects to the Claude Code autonomous agent and tested it on 660 tasks. The results were quite interesting. 1️⃣ AI really can work with messy code The biggest surprise was that the success rate almost didn’t change. The difference in task completion was less than 1%. So even if you have a huge 2000-line file, confusing variable names, and a UserManager class that does almost everything - the agent can still figure it out. Bad code did not destroy AI’s performance. But… 2️⃣ Bad code started to cost money On messy projects, the agent used more resources: around 7–8% more tokens. The only difference is that this developer doesn’t get a salary. It gets tokens. 😄 I’m waiting for the day when job descriptions will say: “Must know how to write clean code to avoid wasting company money on AI tokens.” 😄
https://react.8173195-zu006351.twc1.net/blogs/now-we-can-write-crappy-code-ai-will-understand-it-anyway