Comment by jwpapi

1 month ago

> I know full well that if you ask Claude Code to build a JSON API endpoint that runs a SQL query and outputs the results as JSON, it’s just going to do it right. It’s not going to mess that up. You have it add automated tests, you have it add documentation, you know it’s going to be good.

I feel like this is just not true. An JSON API endpoint also needs several decisions made.

- How should the endpoint be named

- What options do I offer

- How are the properties named

- How do I verify the response

- How do I handle errors

- What parts are common in the codebase and should be re-used.

- How will it potentially be changed in the future.

- How is the query running, is the query optimized.

If I know the answer to all these questions, wiring it together takes me LESS time than passing it to Claude Code.

If I don’t know the answer the fastest way to find the answer is to start writing the code.

Additionally, whilst writing it I usually realize additional edge cases, optimizations, better logging, observability and what else.

The author clearly stated the context for this quote is production code.

I don’t see any benefits in passing it to Claude Code. It’s not that I need 1000s of JSON API endpoints.

> If I know the answer to all these questions, wiring it together takes me LESS time than passing it to Claude Code.

That's just not true, and if it is in your case, then you're not great at writing prompts yet.

> Take the todo_items table in Postgres and build a Micronaut API based around it. The base URL should be /v1/todo_items. You can connect to Postgres with pguser:pgpass@1.2.3.4

That's about all it takes these days. Less lines of code than your average controller.

  • Every day I do something where the llm writes it ten times faster than I would with twice the test coverage.

    And every day I do something else where the LLM output is off enough that I end up spending the same amount of time on it as if I'd done it by hand. It wrote a nice race condition bug in a race I was trying to fix today, but it was pretty easy for me to spot at least.

    And once a week or so I ask for something really ambitious that would save days or even weeks, but 90% of the time it's half-baked or goes in weird directions early and would leave the codebase a mess in a way that would make future changes trickier. These generally suggest that I don't understand the problem well enough yet.

    But the interesting things are:

    1) many of the things it saves 90% of the time on are saving 5+ hours

    2) many of the things I have to rework only cost me 2+ hours

    3) even the things that I throw away make it way faster to discover that 'oh, we don't understand this problem well enough yet to make the right decisions here yet' conclusion that it would be just starting out on that project without assistance

    so I'm generally coming out well ahead.

    • This. There is definitely a ratio. A year ago, it was 50/50. It felt better because the hard things it did fast while I sipped coffee outweighed in my mind the negatives.

      Now that ratio is swinging way over towards the LLMs favor.

  • >you’re not great at writing prompts yet

    How do you reconcile that with your example prompt, which demonstrates no skill requirement whatsoever. It’s the first thing any developer would think of.

    • It’s simple but contains all the necessary info. You can say “build an endpoint to get user data” and it will absolutely do something, but it might be stupid, and when you compound 1000 stupid prompts like that you get spaghetti.

      6 replies →

  • I've drank the AI koolaid so I'm not a hater, but to say "you're just not prompting right" is such a cop-out. Prompting right takes a metric fuck ton of effort. I'm actually kinda agreeing with you, if you make it to where you're dev environment is sufficiently harnessed, then you can give it one-liner magic prompts. But getting there, learning to get there, paying that cost, hot mother of god it's a lot of effort.

    Communicating, in words, is extremely hard. I don't think this should be as controversial as it's seems in the prompt era.

    VS: someone has mastered one of the myriad openAPI generators, and it's shipped.

    • it does take a little while to get good at this new skill, yes. Just like, say, learning a new programming language and the ecosystem around it takes some effort. After you get over the hump it's really very straightforward and mostly a matter of knowing the kinds of mistakes the LLM is likely to make ahead of time, and then kindly asking it to do something smarter. If you've successfully mentored junior engineers you already have this skill.

      1 reply →

    • I'll go in the other direction and say that if you're spending a lot of your time learning to prompt better then you're wasting it because LLMs are only going to get better at understanding your intent regardless of "prompt engineering". The JSON API example to wire up a database can be one-shot pretty easily by the latest models without much context and without setting up any harness. The more time you spend perfecting your harness, the more time you would have wasted when the next model comes out to make it obsolete.

      6 replies →

    • I disagree it's a cop-out, but I agree it's hard to get good at writing prompts and takes a lot of effort. But so is programming. We're trading one skill set for another and getting a bigger return on it.

      I started as a skeptic and have similarly drank the kool-aid. The reality is AI can read code faster than I can, including following code paths. It can build and keep more context than I can, and do it faster as well. And it can write code faster than I can type. So the effort to learn how to tell it what to do is worthwhile.

      1 reply →

    • this seems disingenuous. even if your premise is true (which i don't think it is), it only really holds for the first few endpoints. most systems have many, and the models are very good at copying established patterns to the point that you wouldn't normally have to re-explain every detail for every endpoint. so you might be right for the first (you're not), but you're definitely wrong for the next 50.

      1 reply →

  • > > If I know the answer to all these questions, wiring it together takes me LESS time than passing it to Claude Code.

    > That's just not true, and if it is in your case, then you're not great at writing prompts yet.

    That's just not true, and if it is in your case, then you're not great at writing code yet.

  • > you’re not great at writing prompts yet

    You know what we call adequately specifying the system such that the computer can run it as a viable system.

    Coding. We call it coding.

> If I know the answer to all these questions, wiring it together takes me LESS time than passing it to Claude Code

How so?

  • Like writing code to me is not slower than writing text?

    When I write code every character I type in my computer has less ambiguity than when I write it in human language? I also have the help of LSPs, Linters and Auto-completes.

    • This assumes:

      - that you spend no amount of time looking things up, reorganising, or otherwise getting stuck

      - that you have a solution to the problem ready to go at all times

      - that your solution is better than the LLM's solution

      I highly, highly doubt that all 3 of these are true. I doubt even 1 of them is true, I think you just don't know how to use LLMs in a focused way.

      3 replies →

    • I have a similar sentiment. Subject that makes the claim that AI writing code is fast is going to matter a lot because some programmers heavily use "LSPs, Linters and Auto-completes", key bindings, snippets, CLI commands, etc to speed up writing code

    • It's not much to go on by, but I kinda feel ya. I think one exception I'd perhaps make is doing a large mechanic refactor. I find them incredibly daunting. So, I'll just ask AI for that. I mean it probably takes me a similar time to do, but it feels less daunting.

      I've been trying to get into agentic coding and there are non-refactoring instances where I might reac for it (like any time I need to work on something using tailwind; I'm dyslexic and I'd get actual headaches, not exaggerating, trying to decipher Tailwind gibberish while juggling their docs before AIs came around)

      2 replies →

    • I use voice to text and for me coding is way faster now. You don't need to sit down and type up a perfect spec lol. I give it terrible prompts with poor grammar and typos from incorrect transcriptions and it does an amazing job. Definitely not perfect I iterate with it a ton but it's still faster than typing it out by hand

    • You're still typing? I don't know how fast you can type, but I can speak way faster than I can type. Somewhere in the neighborhood of 300 wpm. Speech-to-text is pretty good now, and prompting an AI means I'm not trying to speak curly brace semicolon new line.

      3 replies →

This may have been a problem a year or two ago but any premium model will be exploring the codebase to check similar routes to answer all these questions, if you don't specify them.

  • Exactly. As long as the codebase is consistently following some given patterns, LLMs nowadays stick to it.

    Understanding that limiting number of “design patterns” in a codebase made it better (easier to code and understand) was a good proxy for seniority before LLMs.

    Now it’s even better: if all of a sudden “unusual code” is in a PR, either the person opening the PR or the one reviewing it has lost touch with the codebase. Very important signal, since you don’t want that to happen with code you care about.

This is just bizarre to me. Do people not use Plan mode?

I start by telling the agent what I'm trying to accomplish, and then I throw in some questions like this, concerns I have, edge cases I've thought about, whatever. It goes out and does all the research, both in my code base and beyond, asks me questions where it needs clarification, and then writes me a plan. I review the plan, we go back and forth a bit with adjustments to the plan, and then the plan is ready for implementation. At that point, the implementation is mostly a formality, because all of the difficult parts are already done.

On top of that, most of what you've described as decisions that need to be made are either trivially made by a frontier model without even needing to be told, or stuff I can bake into my skills so I don't need to specify it on every task.

Given the above, I can't fathom an approach where I'd be faster without AI than with it, because the acceleration is the planning / decision-making, not the implementation. Whether the implementation takes the agent two minutes or six hours really doesn't matter, because I'm not involved at that point.

You can also just talk it out loud to Claude while you’re on a walk getting some sunshine. Done.

  • Yeah I can and I’ve done it and for fun project it’s fun and cool. But its like using templates to build your website. You’ll be annoyed and at one point your project goes in the endless graveyary of abandoned projects

    • I think most people are finding the opposite. Claude Code is not only reducing how many projects get abandoned, it's also resurrecting projects from the graveyard.

      3 replies →

  • Now you're working when you should be taking a break and enjoying your surroundings. Not good!

    • That’s not true. I would not treat a walk where I am working with Claude Code as a break. It’s just as much work as desk work is. You still owe yourself a proper break.

  • I'd rather just be an actual schizophrenic at that point. It seems like less of a mental illness.

    Just be outside and present.

    • So stay inside like prison until I can be outside and present? No thank you. I enjoy mindful meditative walks as well. But I would never force myself to only take such walks. Now that I can be outside and work I will do so precisely for my mental health. Being stationary at a desk all day when you don’t have to be is much more mental illness-like in my opinion.

I’ve seen the best REST APIs since Claude Code has taken the wheel

Every verb implemented, and implemented correctly according to the obscure IETF and most compatible way when the IETF never made it clear

Intuitively named routes, error, authentication all easily done and swappable for another if necessary

I feel like our timeline split if you’re not seeing this

  • I don’t want every verb implemented, I also dont want an IETF standard. I want as little as possible, so I have to worry about as little as possible in the future.

    Use-cases differ, you described a complete REST API, which can be as much of a problem as a too little.

  • the obscure IETF? Which standard is that exactly? Who cares guess - Claude do that stuff.

    • I've tried to implement REST to its exact specifications before, turns out less common verbs like DELETE isn't implemented the same way across platforms and libraries because the IETF never specified. This means no standardization regarding having variables in the path vs the body vs headers, with some libraries or even OS level recognition preventing that, while the server may be looking for it

      this incongruence pushes people back to using just GET and POST methods in flexible and overloaded ways

      Agentic engineering knows all the best practices and ways to get around these limitations in the most compatible way and cranks out full APIs with all the verbs