Live data from Hacker News

Ask HN: How can I get better at using AI for programming?

news.ycombinator.com

51–60 of 491 posts

Re: Ask HN: How can I get better at using AI for programming?

#51
The approach I’ve been taking lately with general AI development:

1. Define the work.

2. When working in a legacy code base provide good examples of where we want to go with the migration and the expectation of the outcome.

3. Tell it about what support tools you have, lint, build, tests, etc.

4. Select a very specific scenario to modify first and have it write tests for the scenario.

5. Manually read and tweak the tests, ensure they’re testing what you want, and they cover all you require. The tests help guardrail the actual code changes.

6. Depending upon how full the context is, I may create a new chat and then pull in the test, the defined work, and any related files and ask it to implement based upon the data provided.

This general approach has worked well for most situations so far. I’m positive it could be improved so any suggestions are welcome.

Re: Ask HN: How can I get better at using AI for programming?

#52

Earlier quoted context omitted.

surprised ai companies are not making this workflow possible instead of leaving it upto users to figure out how to get voice text into prompt.

> surprised ai companies are not making this workflow possible instead of leaving it upto users to figure out how to get voice text into prompt. Claude on macOS and iOS have native voice to text transcription. Haven't tried it but since you can access Claude Code from the apps now, I wonder if you use the Claude app's transcription for input into Claude Code.

> Claude on macOS and iOS have native voice to text transcription

Yeah, Claude/ChatGPT/Gemini all offer this, although Gemini's is basically unusable because it will immediately send the message if you stop talking for a few seconds

I imagine you totally could use the app transcript and paste it in, but keeping the friction to an absolute minimum (e.g., just needing to press one hotkey) feels nice

Re: Ask HN: How can I get better at using AI for programming?

#53
post #15
post #10

Using voice transcription is nice for fully expressing what you want, so the model doesn't need to make guesses. I'm often voicing 500-word prompts. If you talk in a winding way that looks awkward when in text, that's fine. The model will almost certainly be able to tell what you mean. Using voice-to-text is my biggest suggestion for people who want to use AI for programming (I'm not a particularly slow typer. I can…

That's a fun idea. How do you get the transcript into Claude Code (or whatever you use)? What transcription service do you use?

I use Spokenly with local Parakeet 0.6B v3 model + Cerebras gpt-oss-120b for post-processing (cleaning up transcription errors and fixing technical mondegreens, e.g., `no JS` → `Node.js`). Almost imperceptible transcription and processing delay. Trigger transcription with right ⌥ key.

Re: Ask HN: How can I get better at using AI for programming?

#54
post #37

Hey, Boris from the Claude Code team here. A few tips: 1. If there is anything Claude tends to repeatedly get wrong, not understand, or spend lots of tokens on, put it in your CLAUDE.md. Claude automatically reads this file and it’s a great way to avoid repeating yourself. I add to my team’s CLAUDE.md multiple times a week. 2. Use Plan mode (press shift-tab 2x). Go back and forth with Claude until you like the plan b…

> I add to my team’s CLAUDE.md multiple times a week. This concerns me because fighting tooling is not a positive thing. It’s very negative and indicates how immature everything is.

The Claude MD is like the documentation you hand to a new engineer on your team that explains details about your code that they wouldn't otherwise know. It's not bad to need one.

Re: Ask HN: How can I get better at using AI for programming?

#55
Go slowly. Shoot for a 10% efficiency improvement, not 10x. Go through things as thoroughly as if writing by hand, and don't sacrifice quality for speed. Be aware of when it's confidently taking you down a convoluted path and confidently making up reasons to do so. Always have your skeptic hat on. If something seems off, it probably is. When in doubt, exit the session and start over.

I still find chat interface generally more useful than coding assistant. It allows you to think and discuss higher level about architecture and ideas before jumping into implementation. The feedback loop is way faster because it is higher level and it doesn't have to run through your source tree to answer a question. You can have a high ROI discussion of ideas, architecture,algorithms, and code, before committing to anything. I still do most of my work copying and pasting from the chat interface.

Agents are nice when you have a very specific idea in mind, but I'm not yet hugely fond of them otherwise. IME the feedback loop is too long, they often do things badly, and they are overly confident in their oytput, encouraging cursory reviews and commits of hacked-together work. Sometimes I'll give it an ambitious task just in the off chance that it'll succeed, but with the understanding that if it doesn't get it right the first time, I'll either throw it away completely, or just keep whatever pieces it got right and pitch the rest; it almost never gets it right the second time if it's already started on an ugly approach.

But the main thing is to start small. Beyond one-shotting prototypes, don't expect it to change everything overnight. Focus on the little improvements, don't skip design, and don't sacrifice quality! Over time, these things will add up, and the tools will get better too. A 10% improvement every month gets to be a 10x improvement in (math...). And you'll be a lot better positioned than those who tried to jump onto the 10x train too fast because you'll not have skipped any steps.

Re: Ask HN: How can I get better at using AI for programming?

#56
I want to say a lot of mean things, because an extremely shitty, useless, clearly Claude-generated test suite passed the team PR review this week, tests were useless, so useless the code they were linked to (can't say if the code itself was Ai-written though) had a race condition, that, if triggered and used correctly, could probably rewrite the last entry of any of the firewall we manage (DENY ALL is the one I'm afraid about).

But I can't even shit on Claude AI, because I used it to rewrite part of the tests, and analyse the solution to fix the race condition (and how to test it).

It's a good tool, but in the last few weeks I've been more and more mad about it.

Anyway. I use it to generate a shell. No logic inside, just data models, and functions prototypes. That help with my inability to start something new. Then I use it to write easy functions. Helpers I know I'll need. Then I try to tie everything together. I never hesitate to stop Claude and write specific stuff myself, add a new prototype/function, or delete code. I restart the context often (Opus is less bad about it, but still). Then I ask it about easy refactoring or library that would simplify the code. Ask for multiple solutions each time.

Re: Ask HN: How can I get better at using AI for programming?

#57
post #15
post #10

Using voice transcription is nice for fully expressing what you want, so the model doesn't need to make guesses. I'm often voicing 500-word prompts. If you talk in a winding way that looks awkward when in text, that's fine. The model will almost certainly be able to tell what you mean. Using voice-to-text is my biggest suggestion for people who want to use AI for programming (I'm not a particularly slow typer. I can…

That's a fun idea. How do you get the transcript into Claude Code (or whatever you use)? What transcription service do you use?

I use Handy with Claude code. Nice to just have a key combo to transcribe into whatever has focus.

https://github.com/cjpais/Handy

Re: Ask HN: How can I get better at using AI for programming?

#59
This may sound strange but here is how I define my flow.

1. Switch off your computer.

2. Go to a nice Park.

3. Open notebook and pen, and write prompts that are 6-8 lines long on what task you want to achieve, use phone to google specific libraries.

4. Come back to your PC, type those prompts in with Plan mode and ask for exact code changes claude is going to make.

5. Review and push PR.

6. Wait for your job to be automated.

Re: Ask HN: How can I get better at using AI for programming?

#60
post #22

How did you learn how to use AI for coding? I'm open to the idea that a lot of "software carpentry" tasks (moving/renaming files, basic data analysis, etc) can be done with AI to free up time for higher level analysis, but I have no idea where to begin -- my focus many years ago was privacy, so I lean towards doing everything locally or hosted on a server I control so I lack a lot of knowledge of "the cloud" my HN be…

I love the name "software carpentry" haha. IMO, I found those specific example tasks to be better handled by my IDE's refactoring features, though support for that is going to vary by project/language/IDE. I'm still more of a ludite when it comes to LLM based development tools, but the best case I've seen thus far is small first bites out of a big task. Working on an older no-tests code base recently, it's been thing…

Funny usually a lot of my code is software plumbing, and gardening.

In terms of ai assisted programming. I microanage my ai. Give it specific instructions with single steps. Don't really let it build ehoe files by itself as it usually makes a mess of things, bit it's useful when doing predictable changes and marginally faster than doing it manually.

Post reply on HN