Live data from Hacker News

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

news.ycombinator.com

141–150 of 491 posts

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

#141
post #121

Earlier quoted context omitted.

> 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. Sure, for 4/5 interactions then will ignore those completely :) Try for yourself: add to CLAUDE.md an instruction to always refer to you as Mr. bcherny and it will stop very soon. Coincidentally at that…

The Attention algo does that, it has a recency bias. Your observation is not necessarily indicative of Claude not loading CLAUDE.md. I think you may be observing context rot? How many back and forths are you into when you notice this?

I know the reason, I just took the opportunity of answering to a claude dev to point out why it's no panacea and how this requires consistent context management.

Real semi-productive workflow is really a "write plans in markdowns -> new chat -> implement few things -> update plans -> new chat, etc".

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

#142
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…

also after you have a to-and-fro to course correct it on a task, run this self-reflection prompt

https://gist.github.com/a-c-m/f4cead5ca125d2eaad073dfd71efbc...

That will moves stuff that required manually clarifying back into the claude.md (or a useful subset you pick). It does a much better job of authoring claude.md than I do.

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

#143

Earlier quoted context omitted.

Can you show some example? I feel like there would be streams or YouTube lets plays on this if it was working well

A lot of that would be people working on proprietary code I guess. And most of the people I know who are doing this are building stuff, not streaming or making videos. But I'm sure there must be content out there—none of this is a secret. There are probably engineers working on open source stuff with these techniques who are sharing it somewhere.

That’s understandable, I also wouldn’t stream my next idea for everyone to see

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

#144
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?

made this tool to press double control to start and another ctrl to stop which copies to the cliboard

https://github.com/elv1n/para-speak/

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

#145
post #139

Its super frustrating there is no official guide. I hear lots of suggestions all the time and who knows if they help or not. The best one recently is tell the LLM to "act like a senior dev", surely that is expected by default? Crazy times.

When the world is complicated, entangled, and rapidly changing, would you expect there to be one centralized official guide?*

At the risk of sounding glib or paternalistic -- but I'm going to say it anyway, because once you "see it" it won't feel like a foreign idea being imposed on you -- there are ways that help to lower and even drop expectations.

How? To mention just one: good reading. Read "Be a new homunculus" [1]. To summarize, visualize yourself like you are the "thing that lives in your brain". Yes, this is non-sense but try it anyway.

If you find various ways to accept "the world is changing faster than ever before" and it feels like too much. Maybe you are pissed off or anxious about AI. Maybe AI is being "heavily encouraged" for you (on you?) at work. Maybe you feel like we're living in an unsustainable state of affairs -- don't deny it. Dig into that feeling, talk about it. See where it leads you. Burying these things isn't a viable long-term strategy.**

* There is an "awesome-*" GitHub repository for collecting recommended resources to help with Claude Code: [2] But still requires a lot of curation and end-user experimentation: [2] There are few easy answers in a dynamic uncertain world.

** Yes I'm intentionally cracking the door open to "Job loss is scary. It is time to get real on this, including political activism."

[1]: https://mindingourway.com/be-a-new-homunculus/

[2]: https://github.com/hesreallyhim/awesome-claude-code

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

#146
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…

Do you recommend having Claude dump your final plan into a document and having it execute from that piece by piece? I feel like when I do plan mode (for CC and competing products), it seems good, but when I tell it to execute the output is not what we planned. I feel like I get slightly better results executing from a document in chunks (which of course necessitates building the iterative chunks into the plan).

I often use multiple documents to plan things that are too large to fit into a single planning mode session. It works great.

You can also use it in conjunction with planning mode—use the documents to pin everything down at a high-to-medium level, then break off chunks and pass those into planning mode for fine-grained code-level planning and a final checking over before implementation.

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

#147
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’ve yet to see any real work get done with agents. Can you share examples or videos of real production level work getting done? Maybe in a tutorial format? My current understanding is that it’s for demos and toy projects

I use Junie to get tasks done all the time. For instance I had two navigation bars in an application which had different styling and I told it make the second one look like the first and... it made a really nice patch. Also if I don't understand how to use some open source dependency I check the project out and ask Junie questions about it like "How do I do X?" or "How does setting prop Y have the effect of Z?" and frequently I get the right answer right away. Sometimes I describe a bug in my code and ask if it can figure it out and often it does, ask for a fix and often get great results.

I have a React application where the testing situation is FUBAR, we are stuck on an old version of React where tests like enzyme that really run react are unworkable because the test framework can never know that React is done rendering -- working with Junie I developed a style of true unit tests for class components (still got 'em) that tests tricky methods in isolation. I have a test file which is well documented explaining the situation around tests and ask "Can we make some tests for A like the tests in B.test.js, how would you do that?" and if I like the plan I say "make it so!" and it does... frankly I would not be writing tests if I didn't have that help. It would also be possible to mock useState() and company and might do that someday... It doesn't bother me so much that the tests are too tightly coupled because I can tell Junie to fix or replace the tests if I run into trouble.

For me the key things are: (1) understanding from a project management perspective how to cut out little tasks and questions, (2) understanding enough coding to know if it is on the right track (my non-technical boss has tried vibe coding and gets nowhere), (3) accepting that it works sometimes and sometimes it doesn't, and (4) recognizing context poisoning -- sometimes you ask it to do something and it gets it 95% right and you can tell it to fix the last bit and it is golden, other times it argues or goes in circles or introduces bugs faster than it fixes them and as quickly as you can you recognize that is going on and start a new session and mix up your approach.

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

#148
Lots of good suggestions. However for Svelte in particular I’ve had a lot of trouble. You can get good results as long as you don’t care about runes and Svelte 5. It’s too new, and there’s too much good Svelte code out there used in training that doesn’t use Svelte 5. If you want AI generated Svelte code, restricting yourself to (YMMV: this was my experience as of three or four months ago)

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

#149
Hey, I am bgwalter from the anti-AI industrial complex, which is a $10 trillion industry with a strong lobby in DC.

I would advise you to use Natural Intelligence, which will be in higher demand after the bubble has burst completely (first steps were achieved by Oracle this week).

Post reply on HN