-14
What could go wrong with coding and AI usage, right?
(jeferson.me)
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Follow the wormhole through a path of communities !webdev@programming.dev
Yeah Idk. While I do in fact always have issues prompting AI... I kinda also think it has a weird form of "intelligence". I wouldn't say it does really well at following instructions. It tries. Certainly. But sometimes it rather does silly things. Like I recently was trying to prototype some web app. The app didn't work. So I told it to write tests. And it wrote some stub which always passed. I had an argument with the agent how it can't just tell me the project works now, but it always has to follow the usual agentic pattern: Plan, write code, execute the test suite, fix mistakes, repeat and only then add all files to a commit and tell me it's done. And now we need some tests for it itself to see whether the program runs. It just wrote super convoluted tests, launching some headless browsers, didn't ever get it right so ALL the tests kept failing. I told it to test functions and API endpoints instead (which is kind of a no brainer to do anyways). Those also kept failing. And after several hours of this nonsense it told me: TOO HARD, NEED TO FOCUS! And staged a commit which just deleted the entire test suite ๐ Hilarious. But neither what I wanted, nor what I instructed it to do...
I forgot what model that was. I was testing the Hermes Agent at that time.
I never know what amount of hand-holding is expected from me as the human operator. Models keep getting better. A year ago I had them make up convenient, yet nonexistent functions. Like mathproblem.solve() That hasn't hapoened in a while. But I can't be expected to instruct and teach it every tiny detail?!
I'm not a big fan of "agentic" coding. Don't get me wrong, I am trying to create a process by which agentic programming is more reliable, but it's piling AI artifacts on top of AI artifacts. The error rate compounds and by the time it's working on the 5th story everything is garbage. You have to review everything at every step to find and fix those errors to keep everything on track.
I have a lot more success giving it one story at a time โ each one targeted toward small, incremental steps. It does well. Then clear the context out and start another small story. I don't trust agentic programming.
I have an AI to help do production support when I'm in meetings or whatever. It comes to the dumbest conclusions about the root cause and the resolution path. But the logs and queries it pulls for me are very helpful. And sometimes it's analysis holds a bit of useful insight.
Interesting. Most other people seem to use coding agents. I mean I also tried the polar opposite end of the spectrum. Copy-paste snippets into ChatGPT and back. I think that's how a lot of people got started. But it's tedious, still makes me let the AI do things which I later regret in the design. And I tracked my time once or twice for similar tasks. And I was slower than just typing it down myself without any AI assistance. Guess I still have to figure out what to do to get some proper use out of it.
What kind of tools do you use for your workflow? Some IDE plugin or "agent" so it has access to the entire project files, but then give it stories of a size it can tackle in one shot? Or subdivide?
I mean I also tried to subdivide tasks into chunks and hand those out. But that also has some tendency the AI doesn't really get what it's supposed to do because it's missing the broader picture. That was kind of the reason for me to try agents, so it has a plan, knows what's next in line so it doesn't write code which doesn't integrate (as is) into the next step to do.
I use Claude code. I have access to do full on agentic shit, but mostly all it does is fan out an agent or two to read code and documentation. My process is describe specifically what I want sort of like a story. If it takes more than a paragraph or ten bullets to explain in exact detail, it's too big. Generate an implementation plan from a template. Look the plan over. Make any changes. It writes the code, then writes the tests, then updates documentation. I review everything at each step.
The implementation plan is critical because you'll see if it wants to do something like create an enum to hold a single value or refactor the name of a method for no particular reason.
We have extensive documentation of standards and practices, and generally how we structure code. I have templates for things like writing up the implementation plan. Questions that need to be answered. Important context. It has all the information to build it, but you have to double check that it's from the instructions.
I generally have a "smart" model do the planning and a dumber one do the implementation. I make use of skills. I watch it talk to itself and if I see it going off the rails I interrupt it and correct it.
It's not the sexy 10x productivity boost people claim when doing prototyping, but it's clearly faster than doing without. I can get 3 or 4 stories done in an evening after meetings and such. If I have five minutes between meetings I can see what it has done and set it in it's next step.
Last night I had an instance of Claude collecting information for a production support ticket while I had another one work on a ticket in one app and a third working on another app. Every time one got going I'd go over to another and see what was going on.
I tried to create a set of 11 stories to build an entire feature in one go. It was a mess. Yeah I got 11 stories done in two days, but then code review on one would require changes and rebasing dependent stories. I've done more rebasing in the past ten days than the rest of my career. That was a mistake.
My boss is all gung ho about me doing it that way, but I just can't seem to make it work.