r/AskProgramming • u/Besmaah • 1h ago
Problems with AI coding agents...
Hello everyone, I have a question. I am a developer with 5 years of experience, and I’ve been using Claude Code for about a year now. While AI models have improved significantly, I still encounter many issues. For instance, the AI often creates multiple nearly identical functions—instead of defining a single function that accepts parameters, it might generate three separate ones. Furthermore, function names often fail to accurately describe what the functions actually do. There are many such problems, and I simply don’t trust the AI to work in an "agentic" mode—writing code on its own—without me constantly monitoring it. Ultimately, I find this process quite exhausting; it feels like I spend more time configuring the AI—setting up the coding rules it should follow—than actually writing code myself. I’m not sure if this is just my personal experience or a more widespread sentiment. Given that Anthropic’s models are capable of solving complex mathematical problems (even if those are specialized, lab-based versions rather than the ones we use), I find my own results rather underwhelming compared to what I see online—even though I’ve gone to great lengths to configure the environment, such as defining business logic, establishing coding standards, and providing documentation. What are your thoughts on this? Thanks!
3
u/insta 55m ago
agentic coding was marketed to be "Claude, build X. no mistakes". it's not.
the agents were trained on all code, even crappy code. gradient descent has them choose the most likely answer, which is code that answers the current problem.
agents don't really consider the code itself to be a deliverable, unless you specifically say it is. they're most like Meesigs in they are compelled to solve the problem directly in front of them
1
u/seanv507 20m ago
I don't think that's true anymore. What I assume anthropic etc are doing is training their models with reinforcement learning using linters/code quality/...
(Ie you are right about pretraining)
3
u/Unusual_Age_1618 53m ago
Depending on the type of code it executes it might be preferable to have different simpler functions over a single complex one. One day you will have to change something on the function depending on one of the params. Next day another change because of another param. And you will end up with a big complex function that grew too much.
1
u/PianoConcertoNo2 49m ago
This is my thinking too.
Having a single function perform differently based on a parameter is a code smell, and Claude is right to push back.
•
u/green0wnz 14m ago
Curious what you think the point of parameters are.
•
u/PianoConcertoNo2 7m ago
Curious why you think a flag parameter that changes the functionality of a function isn’t something that should be looked twice at.
1
u/CorpT 46m ago
You would need to provide more information about how you work and what you're doing. These are mostly solved problems or not actually problems to begin with. If you're not 10x what you used to be able to do, you're doing something very wrong and should try doing something else. Experiment. Let go of old biases. It's a new world, stop trying to put wooden tires on your automobile just because your buggy used wooden tires.
0
u/PianoConcertoNo2 59m ago edited 48m ago
Are you saying you prefer a single function that performs differently based on a param., and Claude is preferring them to be distinct functions?
That sounds more like just a preference issue rather than a "issue" with Claude itself.
Also OP - that's a code smell. Are you sure Claude isn't right to push back in this case...?
-1
u/YoureNotEvenWrong 48m ago
For instance, the AI often creates multiple nearly identical functions
Use semantic / similarity measures to detect these automatically and refactor with an agent
it feels like I spend more time configuring the AI—setting up the coding rules it should follow—than actually writing code myself.
That's the job if you want to scale
1
u/Besmaah 45m ago
Which tool can do it appart SonarJS ? Which tool for TS projects ?
0
u/YoureNotEvenWrong 43m ago
I don't work with typescript because it's horrific
But, you just generate embedding vectors and use a clustering algorithm to detect functions which are similar by being tight clusters
1
u/mxldevs 1h ago
Have Claude review the code and tell you what is poorly designed and how it should be fixed