Live data from Hacker News

Using AI to write better code more slowly

nolanlawson.com

321–330 of 511 posts

Re: Using AI to write better code more slowly

#321

Earlier quoted context omitted.

And then Anthropic has an outage and you what...have a coffee break until then? All that time babysitting the AIs just to be a little faster but probably with less knowledge/control over what they did?

Codex has 99.98% uptime

Unlike Claude who barely has 2 9s.

Re: Using AI to write better code more slowly

#322

“A lot of people seem convinced that the point of AI coding is to write low-quality code as fast as possible.” A lot of people think a lot of things, but I don’t think the majority of people think the point of using LLMs is so they can produce low-quality code. Do they produce low-quality code sometimes or often? Of course. But they also produce high-quality code very often. And sometimes they just a “fine” job. One…

Eh, I definitely do think that it has become a mainstream take. Not necessarily that we want lower-quality code, but simply that humans shouldn't be reviewing AI code for quality at all - that is, that code quality doesn't really matter and what matters is that the software works. This is the entire premise of the concept of "vibe coding", and the concept of non-programmers using coding agents. The idea that there ar…

But how do I know if something works if I don't know how it works? By testing (literally) all use cases, every single permutation of of variables? For complex programs there might not be enough time and energy in the universe to do that.

If I know what addition is, I can look at at a line that does addition and reason about it. If I just check "if it works", for all I know, the actual code is something like

    if (thing == 17)
    {
      shit_the_bed();
    }
    else
    {
      thing += other_thing;
    }
Sure, I can use an LLM to check on the first LLM, and then a third LLM to check on the second, and so on ad infinitum, but none of that, at no point, can give me what "knowing what addition is" gives me.

It's kinda like cheap/fake concrete: If you know something about concrete and what concrete is being used, you can roughly tell if it will last, what it will withstand. If you just go by "seems to work", "looks good", you get collapsing bridges and buildings after a few years, during heavy rainfall etc.

Re: Using AI to write better code more slowly

#323

Earlier quoted context omitted.

A lot of people say you need to go through at least three versions of something before it is mature - and v3 is not something you can design upfront. You need to see v1 both in code, and at runtime. Use it, get the feedback, and iterate. This is where AI tightens that loop immensely. Lost you in the last paragraph - features are not "copy pasting because you already have all the building blocks" and "something may be…

> Mid sized features often mean tearing up many layers of code across the stack to add in some sort of new capability What? No, it shouldn't. I've worked on a lot of codebases and if you have to do this, something is very, very wrong.

This likely assumes you have a mature and well designed (architected) code base. That is not always the case, and as features get added and removed, that won't be the case at all until there is a refactor.

Re: Using AI to write better code more slowly

#324
post #280

I've hit this point with AI where it's not a simple process, but a long drawn out back and forth. I'll use AI to design the implementation of a medium sized, cross cutting feature. Review all the details, maybe iterate on just that. Then implement with Claude 4.7 Max - which runs slower, but does a better job. Then review the implementation, then have Codex GPT 5.5 xhigh fast review it - which almost always finds cor…

You could just use Xiaomi Mimo for all of that and it would be cheaper and faster than all of them...

I don't care about cheaper. I care about faster.

Re: Using AI to write better code more slowly

#325

Does anyone have good recommendation for ai auto completion? My goal is to draft the solution with ai, write it myself but faster with auto complete, then throw ai review.

So your "goal" is to find an existing ai-auto completion that allows you to draft with AI then "write it yourself" by hitting tab? Sounds like the goal is actually to build that, then use it on projects....

Re: Using AI to write better code more slowly

#326
post #308
post #300

Earlier quoted context omitted.

tbh I'm just confused at why people ask AI to design features. Do you not know how to design a feature? Do you not know what you want? This stuff works so much better when you just tell it what to do

The designing is the hard part. Writing code from a comprehensive design spec is a small part of the task. So, people do know how to design a feature, but they also know it takes a lot of time and effort. They want AI to do that work for them.

My sample size is pretty small but when I've witnessed people (both PMs and engineers) "design through AI" I have seen two flavors:

- aimless AI wandering, leading to pretty, frankly, useless design docs

- using AI to "expand" upon a bullet pointed/shorthanded design doc. To which I feel like saying "the bullet points are already a good design doc!"

I understand that teams sometimes have specific formats that they have to make deliverables for, but having a nice 5 point bulletpoint list turn into 5 paragraphs... all for me to turn the 5 paragraphs back into 5 bullet points in my notes is depressing.

I do think you can get a lot of value in the mechanics, I just have had so much success leaving the thinking to me and the rote stuff to the AI. I'm going to have to think about the design eventually anyways right?

Re: Using AI to write better code more slowly

#327

Does anyone have good recommendation for ai auto completion? My goal is to draft the solution with ai, write it myself but faster with auto complete, then throw ai review.

I like Zed for this. We are considering autocomplete for Rig after we launch our agent. Local would be 1000x faster.

Re: Using AI to write better code more slowly

#328

I've hit this point with AI where it's not a simple process, but a long drawn out back and forth. I'll use AI to design the implementation of a medium sized, cross cutting feature. Review all the details, maybe iterate on just that. Then implement with Claude 4.7 Max - which runs slower, but does a better job. Then review the implementation, then have Codex GPT 5.5 xhigh fast review it - which almost always finds cor…

> I've hit this point with AI where it's not a simple process, but a long drawn out back and forth.

In my experience, even on a relatively trivial task, you can ask an LLM at least 20 times:

Is this actually done, or only partially implemented? Did you finish x, y, z?

And the LLM will say, no, I'm not done and keep working.

After that, I'll feed the branch to a different LLM, and ask if the implementation matched the design, where it's weak and needs improvements.

Same thing - that feedback will usually only be partially finished for several rounds.

When they all agree it's done - I'll finally look at the code, and there's still typically glaringly obvious problems - duplicate systems that reinvent the wheel, etc - that will take typically more than one prompt to get right...

Getting things right takes almost ~100x as long as getting things almost right with LLMs.

You can tell an LLM to "make me Rust, but easier. Make no mistakes," and it'll plan out a 100 commit process and get something that - somehow - sort of works... but isn't even close to complete.

Still, on a cost basis, you're still able to get features that would take yourself several times longer and cost orders of magnitude more money, and - if you're doing it right - they'll probably do a better job than you would've done (at least for me).

Re: Using AI to write better code more slowly

#329

Earlier quoted context omitted.

This feels like a comment from 2 years ago; by now the most modern models write much better code than humans can in much shorter time. But if you're not used to code reviewing, it can certainly help to still write yourself.

> models write much better code than humans can What? I think this is either over exaggerating model capabilities or you haven't seen much good code from humans? My experience is that my colleagues which have bought into model-first development have regressed in quality of the PRs they send out. LLMs are not better coders, in my experience. They lack holistic understanding and often need course correction for that re…

Over my time in the industry I've become increasingly convinced most people haven't seen what good human programmers are like. Otherwise we wouldn't have the popularity of things like Scrum, Clean Code (the book, not the concept), etc.

I was lucky enough to see some good teams when I was a student (both at Berkeley itself and by interning at Jane Street), and it totally changed my intuition for what good programming is like. It's gotten to the point where I'm convinced there are two incommensurable paradigms in programming, and we're constantly talking past each other.

Like, if you have an ongoing project where the codebase has grown over time, do you expect it to get easier to do things or harder? I've worked on projects where it's obvious that things are always getting harder (old code is hard to change, you have to deal with lots of complexity and edge cases and workarounds). I've also worked in codebases where things got easier over time: you get better abstractions, more libraries, more capabilities. That can be a lot of fun; you think of a new thing to try, and you have the pieces to just do it.

Or another point of comparison: do people think that writing good code slows you down (so it only makes sense to avoid bugs), or do people think that writing good code lets you move faster? I've talked to people for whom one or the other is totally and obviously true. (I'm solidly in the second camp myself.)

But the surprising thing was how "obvious" the dynamic was in both cases, even though the two cases are exact opposites of each other! If you ask one group or the other they'd just tell you that, well, that's simply how programming works. Of course things get (easier|harder) over time. That's built into people's fundamental understanding of what programming is and how to do it. And that's exactly what I mean by incommensurable paradigms.

Anyway, this is a bit of a tangent from the main discussion, but it's something I've been thinking about a bunch over the last few years, partly inspired by the advent of AI-powered programming, but largely thanks to experiencing some very different projects and teams...

Post reply on HN