Comment by Jcampuzano2
5 days ago
I find it interesting how many people complain that AI produces code that mostly works but overlooks something, or that it was able to generate something workable but wasn't perfect and didn't catch every single thing on it's first try.
For fucks sake it probably got you to the same first draft you would have gotten to yourself in 10x less time. In fact there plenty of times where it probably writes a better first draft than you would have. Then you can iterate from there, review and scrutinize it just as much as you should be doing with your own code.
Last I checked the majority of us don't one shot the code we write either. We write it once, then iterate on things we might have missed. As you get better you prompt instinctively to include those same edge cases you would have missed when you were less experienced.
Everybody has this delusion that your productivity comes from the AI writing perfect code from step 1. No, do the same software process you normally should be doing, but get to the in between steps many times faster.
Missing the forest for the trees here.
The benefit of writing your own first draft is the same reason why you take notes during classes or rephrase things in your head. You're building up a mental model of the codebase as you write it, so even if the first draft isn't great you know where the pieces are, what they should be doing and why they should be doing it. The cognitive benefits of writing notes is well known.
If you're using an AI to produce code you're not building up any model at all. You have to treat it as an adversarial process and heavily scrutinize/review the code it outputs, but more importantly it's code you didn't write and map. You might've wrote an extensive prompt detailing what you want to happen, but you don't know if it did happen or not.
You should start asking yourself how well you know the codebase and where the pieces are and what they do.
It really depends on the scale of the code you are asking it to produce. The sweet spot for me with current models is about 100-200 lines of code. At that scale I can prompt it to create a function and review and understand it much faster than doing it by hand. Basically using it as super super autocomplete, which may very well be underutilizing it, but at that scale, I am definitely more productive but still feel ownership of the end result.
This has been my experience as well. It removes a major bottleneck between my brain and the keyboard and gets that first pass done really quickly. Sometimes I take it from there completely and sometimes I work with the LLM to iterate a few rounds to refine the design. I still do manual verification and any polish/cleanup as needed, which so far, has always been needed. But it no doubt saves me time and takes care of much of the drudgery that I don’t care for anyway