Using AI to write better code more slowly

74 points by nolan


doronc

I have given up the dream to move faster with AI in my specific workplace. Coding isnt the bottleneck in our case. What I do like about coding agents is the fact they allow me to be the engineer Ive always wanted to be.

Some examples might be building a proper testing harness to push the code a little further, add a CI step to validate generated code is aligned to source or properly monitor a deployment of a change.

This is the future I tell you. Any one of these would have thrown me into something I couldnt afford due to timelines like reading Gitlab CI manuals to understand how to build the conditions right and figure out the crooked way we do it.

jfredett

I've found a great deal of success with pushing LLMs into the 'API aware spike partner' and 'Mechanical Refactor Machine' -- especially in highly typed languages. They're also great for writing tests if you have a multilayer process that makes sure those tests have some constraining power (mutant testing seems to get me a good ways there, as well as multiple review passes, as suggested by the OP).

I definitely have had a much more negative opinion about LLMs in the past, irrationally so in retrospect, but that was borne mostly out of the firehose of slopware they were producing. Once I dug in and started to treat them more like a tool for cardboard-prototyping and as a much faster typist (it is a godsend to be able to say, "For every theorem in this Lean project, identify <this> pattern and replace it with <this> one instead, flag anywhere it doesn't work out of box and give me a list of stragglers" and have it chunk update 100+ theorems in about the same time it would've taken me to write the first or second iteration of whatever unholy combination of vim, sed, awk and chewing gum I would've put together. Lean is particularly nice here because there isn't much room between 'Compiles' and 'Works' by nature of the language and the stuff I'm doing in it; but I get much the same experience working with Rust and a good test suite + mutation.

I definitely think the long tail of these tools isn't 'push button receive product' -- good engineers should be able to incorporate them to accelerate and focus their energy on the stuff that matters; and delegate a lot of the stuff that used to be scutwork to the machine.