| ▲ | Unproven4275 an hour ago | |
I mean I also think it's the way you prompt it. Whenever I bug fix, I prompt it specifically to solve the problem not fix the symptom of the problem, and do so with the least amount of code changes possible to fix the problem. And I also tell it that if there's a more maintainable way to solve the problem(like prevent similar issues in other parts of the project, ie problems with a particular dependency or library being used) to suggest alternatives. I think it's also important that the AI either has context to your entire project(like ability to read the source), or you put the context of what it's solving in the prompt you give it specifically. | ||
| ▲ | frostiness 20 minutes ago | parent [-] | |
Neither of these prompts effectively address the problem though. Fixing the root cause and doing so with the least amount of code often is contradictory. Including instructions to make suggestions to improve code maintainability will cause the AI to do it every single time it makes a change, even if it's completely unnecessary, drowning out useful suggestions in noise. When a bug is caused by a requirement elsewhere in the application, current models are more likely to break that functionality and implement a fix anyway rather than pause and get confirmation on the requirement. They may leave a note about the broken functionality at the end, but by that point the AI has already been iterating with an incorrect assumption. Any code the agent wrote in the same turn is going to be tainted by that assumption and it often does not remove or rewrite that code when given clarified requirements. It's tempting to blame all AI issues on prompting because it's the only thing that we're able to control, but if a task falls into the long tail of work unable to be satisfactorily completed with AI, there's no prompt that will work. When there's always the alternative of doing the work yourself, it's not worthwhile to spend the tokens or time to get an AI model to do something after the first two or three prompts. | ||