> After all the effort getting to the point where the generated code is acceptable, one has to wonder, why not just write it yourself?Because it is still way, way, way faster and easier. You're absolutely right that the hard part is figuring out the solution. But the time spent typing is in no way trivial or cognitively simple, especially for more complex tasks. A single prompt can easily generate 5 - 10x the amount of code in a few seconds, with the added bonus that it:
a) figures out almost all the intermediate data structures, classes, algorithms and database queries;
b) takes care of all the boilerplate and documentation;
c) frequently accounts for edge cases I hadn't considered, saving unquantifiable amounts of future debugging time;
d) and can include tests if I simply ask it to.
In fact, these days once I have the solution figured out I find it frustrating that I can't get the design in my head into the code fast enough manually. It is very satisfying to have the AI churn out reams of code, and immediately run it (or the tests) to see the expected result. Of course, I review the diff closely before committing, but then I do that for any code in any case, even my own.