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
Show all comments
Showing thread 40 of 111
Building tests first has always been a strong methodology, but with AI support its both far less work AND you get double dividends, because your test becomes the spec the AI needs to follow but it's an executable, verifiable one. So as you give it more requirements, it's automatically finding and fixing its mistakes along the way.
In terms of having it code how you like: nothing beats putting examples into AGENTS.md / CLAUDE.md etc. Give it some examples of how you like it, and say this is how the code is written. Make remarks about why as well, put the design philosophy in too.