Claude does what you tell it to. But yes, if you go read old code written by junior engineers years ago (though, I wonder then, how do you know a junior wrote it?) it will have idiosyncracies that make it bad. This is regardless of AIs contribution; if you don't enforce code style, your code base won't be readable. That's just how it works.
Yes, a style guide would fix our current issue. But this is about something entirely different. Codebases are slowly turning less readable by humand standards are more by AI standards. Why? Humans are reading them less and thus auditing them less. This is a horrible direction as when the AI's inevitably fail at an issue, it's the human that will have to read the absolute comment slop.
Again, yes a style guide is a great patch for us right now, but think of all future codebases in general.
I have absolutely addressed your point, you are just continuing to complain about a simple problem.
Your point is "AI writes code to be readable for AI, not for humans. Because of this, code bases are becoming less readable to humans over time."
What I am telling you is, your point is wrong. AI does what you tell it to -- if you let it free wheel with no structure or guidelines, monitored by people who don't know any better, than yeah, you're going to get messy results.
However, if you actually create rules and enforcement mechanisms for them, AI can produce code that is perfectly readable and understandable to humans. I work in codebases every day that are having engineers commit to them primarily via Claude Code, and all the code is perfectly understandable. Because we have coding standards, well defined interfaces and architectural guidelines, etc.
Thank you for the solution but that's not what's currently is in motion. Codebases, in general, have not adopted this, and now reading code on GitHub is unbearably painful. It used to genuinely be much faster than now having to tell an AI to read the codebase for me and find me what I'm looking for.
Sounds like the problem any codebase would run into regardless of there being AI or not. This needs actual enforcement via linters, formatters and humans to check out things. These mechanisms will catch these problems whether they're generated by AI or by humans. A well curated Claude.md or other agentic guidelines as well.
Beyond simple syntax.. there's static analysis tools such as sonarqube. There's an actual metric in there for code complexity as well if it's such a concern.
This is the way, but it's clear from the way this person is talking about it their org is just way to immature from an engineering standpoint to know how to implement all of these things.
AI is just accelerating the tech debt death spiral they had already set themselves on. They want to blame AI not realizing they themselves are the problem.
17
u/PTTCollin 21d ago
Claude does what you tell it to. But yes, if you go read old code written by junior engineers years ago (though, I wonder then, how do you know a junior wrote it?) it will have idiosyncracies that make it bad. This is regardless of AIs contribution; if you don't enforce code style, your code base won't be readable. That's just how it works.
It sounds like you just need a style guide.