Ask HN: How can I get better at using AI for programming?
471 pointsI've had a fairly steady process for doing this: look at each route defined in Django, build out my `+page.server.ts`, and then split each major section of the page into a Svelte component with a matching Storybook story. It takes a lot of time to do this, since I have to ensure I'm not just copying the template but rather recreating it in a more idiomatic style.
This kind of work seems like a great use case for AI assisted programming, but I've failed to use it effectively. At most, I can only get Claude Code to recreate some slightly less spaghetti code in Svelte. Simple prompting just isn't able to get AI's code quality within 90% of what I'd write by hand. Ideally, AI could get it's code to something I could review manually in 15-20 minutes, which would massively speed up the time spent on this project (right now it takes me 1-2 hours to properly translate a route).
Do you guys have tips or suggestions on how to improve my efficiency and code quality with AI?
Comments (469) 111 threads
Earlier commentsare we following the project’s architectural guidelines?
Is the right visual spacing on every page in the UI?
The better the agent’s tools are at finding problems and informatively (in English) recommending fixes to the agent, the more leveraged you will be.
Basically a good multiplier, and an assistant for mudane task, but not a replacement. Still requires the user to have good understanding about the codebase.
Writing summary changes for commit logs is amazing however, if you're required to.
before getting into any implementation, i'd get claude to read and document the starting code, and propose its own idiomatic way to rewrite it to svelte. this is a good use for plan mode, and also a spot where you could walk through with claude to put documentation examples of what you consider good and bad, so it can monkey-see, monkey do.
the other thing that makes it go brrrr is to add lots of feedback loops. unit tests, e2e tests, linters, etc. make sure it can pass everything before it shows you anything.
my overall process would be to
1. go through plan mode for documentation and test writing
2. have claude lay out the plan into steps
3. project setup for builds/feedback loops, deploys, etc
4. for each step in that plan, run back through plan mode to clear up any confusions for the component (also record those in docs) and then let it rip on implementation until its ready for a commit.
claude might take a long time writing the code between qna sessions, but it can all be async so the 15-20min doesnt matter much
All comments shown.
Couldn't load more comments. Check your connection and try again.