Hacker News new | ask | show | jobs
by yoyohello13 495 days ago
See THIS is a usage that makes sense to me. Using AI to manipulate existing code like this is great. I save a ton of time by pasting in a json response and saying something like “turn this into Data classes” makes api work so fast. On the other hand I really don’t understand devs that say they are using AI for ALL their code.
2 comments

Copilot kind of auto completes exactly what I want most of the time. When I want something bigger I will ask Claude to give me that, but I always know what I am going to get, and I could have written it myself, it would have just taken tons of typing. I feel like I am kind of an orchestrator of sorts.
So if you were to do a transformation like that you'd cut the code and paste it into a new function. Then you'd modify that function to make the abstraction work. An LLM will rewrite the code in the new form. It's not cut/paste/edit. It's a rewrite every time with the old code as reference.

Each rewrite is a chance to add subtle bugs, so I take issue with the description of LLMs "working on existing code". They don't use text editors to manipulate code like we do (although it might be interesting if they did) and so will have different issues.

> It's a rewrite every time with the old code as reference.

As far as I'm aware, tools like Aider don't do this, it does targeted changes.

The way I do it "copy/paste into chat interface", I just have the relevant context and just change the parts required.