Comment by pron

3 days ago

I've yet to use an LLM for coding, so let me ask you a question.

The other day I had to write some presumably boring serialization code, and I thought, hmm, I could probably describe the approach I want to take faster than writing the code, so it would be great if an LLM could generate it for me. But as I was coding I realised that while my approach was sound and achievable, it hit a non-trivial challenge that required a rather advanced solution. An inexperienced intern would have probably not been able to come up with the solution without further guidance, but they would have definitely noticed the problem, described it to me, and asked me what to do.

Are we at a stage where an LLM (assuming it doesn't find the solution on its own, which is ok) would come back to me and say, listen, I've tried your approach but I've run into this particular difficulty, can you advise me what to do, or would it just write incorrect code that I would then have to carefully read and realise what the challenge is myself?

It would write incorrect code and then you'd need to go debug it, and then you would have to come to the same conclusion that you would have come to had you written it in the first place, only the process would have been deeply frustrating and would feel more like stumbling around in the dark rather than thinking your way through a problem and truly understanding the domain.

In the instance of getting claude to fix code, many times he'll vomit out code on top of the existing stuff, or delete load bearing pieces to fix that particular bug but introduce 5 new ones, or any number of other first-day-on-the-job-intern level approaches.

The case where claude is great is when I have a clear picture of what I need, and it's entirely self contained. Real life example, I'm building a tool for sending CAN bus telemetry from a car that we race. It has a dashboard configuration UI, and there is a program that runs in the car that is a flutter application that displays widgets on the dash, which more or less mirror the widgets you can see on the laptop which has web implementations. These widgets have a simple, well defined interface, and they are entirely self contained and decoupled from everything else. It has been a huge time saver to say "claude, build a flutter or react widget that renders like X" and it just bangs out a bunch of rote, fiddly code that would have been a pain to do all at once. Like, all the SVG paths, paints, and pixel fiddling is just done, and I can adjust it by hand as I need. Big help there. But for the code that spans multiple layers of abstraction, or multiple layers of the stack, forget about it.

  • I have been seeing this sort of mindset frequently in response to agentic / LLM coding. I believe it to be incorrect. Coding agents w Claude 4 Opus are far more useful and accurate than these comments suggest. I use LLMs everyday in my job as a performance engineer at a big company to write complex code. It helps a ton.

    The caveat is that user approach makes all the difference. You can easily end up with these bad experiences if you use it incorrectly. You need to break down your task into manageable chunks of moderate size/complexity, and then specify all detail and context rigorously, almost to the level of pseudocode, and then re-prompt any misunderstandings (and fail fast and restart if LLM misunderstands). You get an intuition for how to best communite with the LLM. There’s a skill and learning curve to using LLMs for coding. It is a different type of workflow. It is unintuitive that this would be true, (that one would have to practice and get better at using them) and that’s why I think you see takes waving off LLMs so often.

    • I didn't wave off Claude code or LLMs at all here. In fact, I said they're an incredible speedup for certain types of problem. I am a happy paying customer of Claude code. Read the whole comment.

    • (I'm critical of LLMs but mean no harm with this question) Have you measured if this workflow is actually faster or better at all? I have tried the autocomplete stuff, chat interface (copy snippets + give context and then copy back to editor) and aider, but none of these have given me better speed than just a search engine and the occasional question to ChatGPT when it gets really cryptic.

      1 reply →

    • I agree. Sonnet 4 has been a breeze to work with. It makes mistakes, but few.

      At least for the CRUDs that I make, I really don't think I need a better model. I just wanted it to get much cheaper.

  • I'm like 60% there with you:

    * When it gets the design wrong, trying to talk through straightening the design out is frustrating and often not productive.

    * I've learned to re-prompt rather than trying to salvage a prompt response that's complicatedly not what I want.

    * Exception: when it misses functional requirements, you can usually get a session to add the things it's missing.

    • Here's the thing, though. When working with a human programmer, I'm not interested in their code and I certainly don't want to see it, let alone carefully review it (at least not in the early stages, when the design is likely to change 3 or 4 times and the code rewritten); I assume their code will eventually be fine. What I want from a programmer is the insight about the more subtle details of the problem that can only be gained by coding. I want them to tell me what details I missed when I described an approach. In other words, I'm interested in their description of the problems they run into. I want their follow-up questions. Do coding assistants ask good questions yet?

      3 replies →

    • > * When it gets the design wrong, trying to talk through straightening the design out is frustrating and often not productive.

      What I have learned is that when it gets the design wrong, your approach is very likely wrong (especially if you are doing something not out of ordinary). The solution is to re-frame your approach and start again to find that path of least resistance where the LLM can flow unhindered.

  • >It would write incorrect code and then you'd need to go debug it, and then you would have to come to the same conclusion that you would have come to had you written it in the first place, only the process would have been deeply frustrating

    A. I feel personally and professionally attached.

    B. Yea don’t do that. Don’t say “I want a console here”. Don’t even say “give me a console plan and we’ll refine it”. Write the sketch yourself and add parts with Claude. Do the iiital work yourself, have Claude help until 80%, and for the last 20% it might be OK on its own.

    I don’t care what anyone claims there are no experts in this field. We’re all still figuring this out, but that worked for me.

    • > Yea don’t do that. Don’t say “I want a console here”. Don’t even say “give me a console plan and we’ll refine it”. Write the sketch yourself and add parts with Claude.

      Myself, I get a good mileage out of "I want a console here; you know, like that console from Quake or Unreal, but without silly backgrounds; pop out on '/', not '~', and exposing all the major functionality of X, Y and Z modules; think deeply and carefully on how to do it properly, and propose a plan."

      Or such.

      Note that I'm still letting AI propose how to do it - I just give it a little bit more information, through analogy ("like that console from Quake") or constraints ("but without silly backgrounds"), as well as hints at what I feel I want ("pop out on '/'", "exposing all major functionality of ..."). If it's a trivial thing I'll let it just do it, otherwise I ask for a plan - that in 90%+ cases I just wave through, because it's essentially correct, and often better than what I could come up with on the spot myself! LLMs have seen a lot of literature and production-ready code, so usually even their very first solution already accounts for pitfalls, efficiency aspects, cross-cutting concerns and common practice. Doing it myself, it would likely take me a couple iterations to even think of some of those concerns.

      > I don’t care what anyone claims there are no experts in this field. We’re all still figuring this out, but that worked for me.

      Agreed. We're all figuring this out as we go.

I don’t know if a blanket answer is possible. I had the experience yesterday of asking for a simplification of a working (a computational geometry problem, to a first approximation) algorithm that I wrote. ChatGPT responded with what looked like a rather clever simplification that seemed to rely on some number theory hack I did not understand, so I asked it to explain it to me. It proceeded to demonstrate to itself that it was actually wrong, then it came up with two alternative algorithms that it also concluded were wrong, before deciding that my own algorithm was best. Then it proceeded to rewrite my program using the original flawed algorithm.

I later worked out a simpler version myself, on paper. It was kind of a waste of time. I tend not to ask for solutions from whole cloth anymore. It’s much better at giving me small in-context examples of API use, or finding handy functions in libraries, or pointing out corner cases.

  • I think there's two different cases here that need to be treated carefully when working with AI:

    1. Using a well know but complex algorithm that I don't remember fully. AI will know it and integrate it into my existing code faster (often much, much faster) than I could, and then I can review and confirm it's correct

    2. Developing a new algorithm or at least novel application of an existing one, or using a complex algorithm in an unusual way. The AI will need a lot of guidance here, and often I'll regret asking it in the first place.

    I haven't used Claude Code, however every time I've criticized AI in the past, there's always someone who will say "this tool released in the last month totally fixes everything!"... And so far they haven't been correct. But the tools are getting better, so maybe this time it's true.

    $200 a month is a big ask though, completely out of reach for most people on earth (students, hobbyists, people from developing countries where it's close to a monthly wage) so I hope it doesn't become normalized.

    • > I haven't used Claude Code, however every time I've criticized AI in the past, there's always someone who will say "this tool released in the last month totally fixes everything!"... And so far they haven't been correct. But the tools are getting better, so maybe this time it's true.

      The cascading error problem means this will probably never be true. Because LLMs are fundamentally guess the next token based on the previous tokens, whenever it gets a single token wrong - future tokens become even more likely to be wrong which snowballs to absurdity.

      Extreme hallucination issues can probably eventually be resolved by giving it access to a compiler and, where appropriate, you could also probably feed it test cases, but I don't think the cascading errors will ever be able to be resolved. The best case scenario will eventually it being able to say 'I don't know how to achieve this.' Of course then you ruin the mystique of LLMs which think they can solve any problem.

      4 replies →

  • You really can’t compare free "check my algorithm" ChatGPT with $200/month "generate a working product" Claude Code.

    I’m not saying Claude Code is perfect or is the panacea but those are really different products with orders of magnitude of difference in capabilities.

Short answer: Not yet

Longer answer: It can do an okay job if you prompt it certain specific ways.

I write a blog https://generative-ai.review and some of my posts walk through the exact prompts I used and the output is there for you to see right in the browser[1]. Take a look for some hand holding advice.

I personally tackle AI helpers as an 'external' internal voice. The voice that you have yourself inside your own head when you're assessing a situation. This internal dialogue doesn't get it right every time and neither does the external version (LLM).

I've had very poor results with One Stop Shop builders like Bolt and Lovable, and even did a survey yesterday here on HN on who had magically gotten them to work[2]. The response was tepid.

My suggestion is paste your HN comment into the tool OpenAI/Gemini/Claude etc, and prefix "A little bit about me", then after your comment ask the original coding portion. The tool will naturally adopt the approach you are asking for, within limits.

[1] https://generative-ai.review/2025/05/vibe-coding-my-way-to-e... - a 3D scene of ancient pyramid construction .

[2] https://news.ycombinator.com/item?id=44513404 - Q: Has anyone on HN built anything meaningful with Lovable/Bolt? Something that works as intended?

Usually it boils down these questions (this is given you have some sorts of AGENTS.md file):

- is this code that been written many times already?

- Is there a way to verify the solution? (think unit test, it has to be something agent can do on its own)

- Does the starting context has enough information for it to start going in the right direction? (I had claud and openhands instantly digging themselves holes, and then I realized there was zero context about the project)

- Is there anything remotely similar already done in the project?

> Are we at a stage where an LLM (assuming it doesn't find the solution on its own, which is ok) would come back to me and say, listen, I've tried your approach but I've run into this particular difficulty, can you advise me what to do, or would it just write incorrect code that I would then have to carefully read and realise what the challenge is myself?

I've had LLM telling me it couldn't do and offered me some alternative solutions. Some of them are useful and working; some of them are useful, but you have a better one; Some feel like they made by a non-technical guy at a purely engineering meetings.

No, we're not at this stage. This is exactly the reason why so many of us say that this tools are dangerous in the hands of inexperienced developers. Claude Code will usually try to please you instead of challenging your thoughts. It will also say it did x when in reality it did something slightly else.

If you combine models/agents with formal systems, you can get them to come back when they're in a corner today: https://gist.github.com/b7r6/b2c6c827784d4e723097387f3d7e1d8...

This interaction is interesting (in my opinion) for a few reasons, but mostly to me it's interesting in that the formal system is like a third participant in the conversation, and that causes all the roles to skew around: it can be faster to have the compiler output in another tab, and give direct edit instructions: do such on line X, such on line Y, such on line Z than to do anything else (either go do the edits yourself or try to have it figure out the invariant violation).

I'm basically convinced at this point that AI-centric coding only makes sense in high-formality systems, at which it becomes wildly useful. It's almost like an analogy to the Girard-Reynolds isomorphism: if you start with a reasonable domain model and a mean-ass pile of property tests, you can get these things to grind away until it's perfect.

Depends whether you asked it to just write the code, or whether you asked it to evaluate the strategy, and write the code if nothing is ambiguous. My default prompt asks the model to provide three approaches to every request, and I pick the one that seems best. Models just follow directions, and the latest do it quite well, though each does have a different default level of agreeability and penchant for overdelivering on requests. (Thus the need to learn a model a bit and tweak it to match what you prefer.)

Overall though, I doubt a current SotA LLM would have much of an issue with understanding your request, and considering the nuances, assuming you provided it with your preferred approach to solving problems (considering ambiguities, and explicitly asking follow up questions for more information if it considers it necessary-- something that I also request in my default prompt).

In the end, what you get out is a product of what you put in. And using these tools is a non-trivial process that takes practice. The better people get with these tools, the better the results.

You can embed these requirements into conventions that systematically constrain the solutions you request from the LLM.

I’ve requested a solution from Sonnet that included multiple iterative reviews to validate the solution and it did successfully detect errors in the first round and fix them.

You really should try this stuff for yourself - today!

You are a highly experienced engineer and ideally positioned to benefit from the technology.

Are we at a stage where an LLM (assuming it doesn't find the solution on its own, which is ok) would come back to me and say, listen, I've tried your approach but I've run into this particular difficulty, can you advise me what to do, or would it just write incorrect code that I would then have to carefully read and realise what the challenge is myself?

Short answer: Maybe.

You can tell Claude Code under what conditions it should check in with you. Having tests it can run to verify if the code it wrote works helps a lot; in some cases, if a unit test fails, Claude can go back and fix the error on its own.

Providing an example (where it makes sense) also helps a lot.

Anthropic has good documentation on helpful prompting techniques [1].

[1]: https://docs.anthropic.com/en/docs/build-with-claude/prompt-...

This would be a great experiment to run, especially since many frontier models are available for free (ChatGPT doesn't even require a sign-up!) I'd be very curious to find out how it does.

In any case, treat AI-generated code like any other code (even yours!) -- review it well, and insist on tests if you suspect any non-obvious edge cases.

> Are we at a stage where an LLM (assuming it doesn't find the solution on its own, which is ok) would come back to me and say, listen, I've tried your approach but I've run into this particular difficulty,

Not really. What you would do is ask the model to work through the implementation step by step with you, and you'd come across the problem together.

I've seen Claude Code run in endless circles before, consuming lots of tokens and money, bouncing back and forth between two incorrect approaches to a problem.

If you work with Claude though, it is super powerful. "Read these API docks and get a scaffolding set up, then write unit tests to ensure everything is installed correctly and the basic use case works, then ask me for further instructions."

The question is really - while this LLM is working, what can you get a second and a third LLM to do? What can you be doing during that time.

If your project has only one task that can be completed, then yeah. Maybe doing it yourself is just as fast.

Related to correctness, if the property in question was commented and documented it might pick up that it was special. It's going to be checking references, data types, usages and all that for sure. If it's a case of one piece having a different need that fits within the confines of the programming language, I think the answer is almost certainly.

And honestly, the only way to find out is to try it.

A lot of the time you see in its "Thinking" it will say things like "The user asked me to create X, but that isn't possible due to Y, or would be less than ideal, so I will present the user with a more fitting solution."

Most of the time, with the latest models, in my experience the AI picks up what I am doing wrong and pushes me in the right direction. This is with the new models (o3, C4, Grok4 etc). The older non-thinking ones did not do this.

  • In my case, there is no wrong or impossible direction, just a technical detail that you realise you must overcome when you start to code and that I doubt the model will be able to solve on its own. What it should do is start coding, realise the difficulty, and then ask me how to solve it. Do those agents do that kind of thing yet? Mind you, I'm not interested in the code, only in the question that writing the code would allow a programmer to ask.

I don't really use the llms but I do enjoy pasting chunks of my code into free models with the question: what is wrong with this?

That way it hs no context from writing it itself nor does it try to improve anything. It just makes up reasons why it could be wrong. It goes after the unusual parts it would seem which answers the question reasonably.

Perhaps more sophisticated models will find less obvious flaws if that is the only thing you ask.

It depends on the problem but Claude sometimes does. You need do need an alternative prompt where you make him suspicious to explore other paths.

Here is an article I wrote a while back: https://omarabid.com/gpt3-now

GPT 4.5 was able to detect a Rust ownership issue, something which requires "ahead of time" thinking.

You won't know until you try. Maybe it will one shot the task. Maybe not. There's not nearly enough context to tell you one way or another. Learning about prompting techniques will affect your results a lot though.

I have tried and failed to get any LLM to "tell me if you don't have a solution". There may be a way to prompt it, but I've not discovered it. It will always give you a confident answer.

  • It always has a solution. A more effective approach is "Start by asking clarifying questions until the task is completely defined".

    • But the questions I'm interested in cannot be asked until the programmer starts to code. It's not that the task is unclear, but that coding reveals important subtleties.

      2 replies →

I find it helps me hit these moments faster since I can watch it go and cut it off when I realize the issue.