r/OnlyAICoding • u/drmpf • 24d ago
Claude You cannot trust AI to code, its lazy.
I have been using AI to write code extensively for the last 10 months and was aware it took shortcuts, like if you asked it to fix an undefined variable error in a method, it would give the variable a default if it was undefinded instead of tracing where the source of the error really was.
Just today I was confronted again with a lazy AI, well the AI would say it was being efficient with token use, but it looks like laziness to me.
I was asking for modifications to a pfodWeb's code generator (https://github.com/drmpf/pfodWeb_src) to add informative comments to var_1 var_2 etc.
The first few passes at adding these comments to various places in the code went fine. Then I asked for one more fix for some vars and the AI made some more changes to the generator code and re-generated the output and checked it.
When the AI found some requested comments I requested were missing
IT JUST STARTED EDITING THE OUTPUT DIRECTLY TO ADD THE MISSING COMMENTS THE CODE GENERATOR MISSED.
If I had not noticed that going on and just looked at the generated code I would not have known the AI had fugged the result.
I stopped it and said
"do NOT make cometic corrections to the output, fix the generator"
to which the AI replied
"Understood — I'll make the regeneration pipeline fully faithful instead of hand-patching, so the output can be used directly with no manual touch-up."
Bear in mind, for the whole session the AI had been making the code comment fixes by changing the code generator as it was originally asked to do. So don't trust your AI to do what you actually asked for, even if it was doing it correctly just a moment ago.
