It started, by giving me a 2,500-line (about 50% documentation) viewcontroller that ate so much memory that the app would jetsam after the user just did a couple of things.
I then, spent about a week, tracking down memory issues, until we narrowed it down to the MapKit cache. All this time, the LLM was making the code scarier and scarier. It was exactly what I would expect from an inexperienced (but smart) engineer, panicking, and adding more and more cruft.
The LLM ended up suggesting fixes that didn’t work that well, and made the UI janky. Also, it was terrifyingly delicate. I don't think it would have survived one feature request.
By now, the viewcontroller was over 4,000 lines.
I asked the LLM to refactor for redundancy, quality, and size.
It removed all the documentation and logging, reducing the size back to about 2,500 lines (about 1% documentation).
Yay.
Except all of the bush-league threading and awful workaround shit was still in there, but now impossible to understand.
At this point, I gave up, threw out the LLM code, and rewrote the viewcontroller from scratch. Took a day and a half. I figured out how to force MapKit to flush its cache (2 lines of code). It's a well-known issue, and the solution was the first StackOverflow answer that showed up in the search.
It’s currently about 1,400 lines (about 50% is documentation), and works great.
Lesson learned.