I sent the recursive code to a coworker who has Chat GPT-4 and not only did it create an iterative solution correctly on the first prompt, it pointed out that the original code had an off-by-one error
davidmurdoch on Hacker News
off-by-one error that occurrs in only 1/128 of cases
In the thread “ChatGPT Changed How I Write Software”, replying to this comment
Helped: GPT-4 correctly refactored complex recursive code to iterative and identified a subtle bug.
Got in the way: GPT-3.5 failed to implement the iterative conversion correctly.
… I tried Chat GPT 3.5 and it failed miserably. I sent the recursive code to a coworker who has Chat GPT-4 and not only did it create an iterative solution correctly on the first prompt, it pointed out that the original code had an off-by-one error that occurrs in only 1/128 of cases, and due to compounding rounding, manifests in real world situations even less often. So GPT 3.5 is great for doing trivial things I already know how to do AND describe accurately, things I'd ask a junior engineer to tackle, but GPT 4 seems to be able to do things I struggle with. …