https://learnprompting.org/docs/intermediate/chain_of_though...
Providing context, getting GPT to explain the steps before doing them, creating feedback loops, etc is super helpful when doing this stuff.
It's still useful to just go "write this function in x language" but anything beyond a Stack-Overflow type copy/paste script it helps to do a lot more hand-holding. The ROI is worth it.
Worst case scenario, throw the code back into GPT and ask it to make the changes you want to make.
This is also one of the reasons I transitioned to developing AI models myself. At least I'll be safe until they start rewriting themselves from the ground up. And at that point we'll all have bigger worries to deal with anyway.
The key is to a) give it context, and b) give it constraints, and to do it from the very first prompt itself.
Most chatGPT failures that I've seen add context and constraints after the initial prompt, which someone sends GPT into a loop.
If you have data in a particular format, mention that in the first prompt. Also helpful to tell it to optimize the code for scalability and to use any external libraries if necessary.
These tools are essentially software programs, and like any piece of software, you need to know the right commands to get maximum utility out of them.
> Working with ChatGPT4 for this task was like working with a good intern programmer who is rather forgetful and a bit scattered.
And the key take-away -- again, for me -- is this:
> But: This has already changed the way I code. I am not sure I am ever going to write code completely by hand again! And I expect these tools to get better fast.