You might want to try Claude 3.5 Sonnet instead of Chat GPT. Claude 3.5 Sonnet seems to be a generational advance over earlier AIs like Chat GPT. I find that I can reliably uses it in cases where Chat GPT produces pure hallucinatory nonsense. I've only seen Claude hallucinate once, and that after I had incorrectly told it that its answer was wrong. It's not the only AI that does code well, but at this particular snapshot in time (Oct 2024), general concensus seems to be that it is currently the best.
It has fundamentally changed the way I write code. And I'm still exploring the boundaries of what kinds of tasks I can feed it. (45 year veteran senior programmer).
Sorry for the TLDR post, but I find it difficult to briefly make the case for why Claude 3.5 Sonnet (and other similarly modern and capable AIs) are fundamentally different from smaller and older AIs when it comes to use as a coding assistant.
I do use it for simple tedious things like "Convert an ISO date string in GMT to a std::chrono::systemclock::timepoint" (requires use of 3 generations of C/C++/Posix library functions that would take about 15 minutes of wading through bad documentation and several false starts to get right).
But have also had success with larger fragments ranging up to 100 or 200 lines of code. It still has distinct limitations (bizarre choices of functional composition, and an unpleasant predilection for hard-coded integer constants, which can be overcome with supplementary prompts. Seems to be brilliant tactically, and shows a terrifyingly broad knowledge of APIs and libraries across the the three platforms I use (android/javascript, typescript/React/MUI, C++/linux). But doesn't yet have a good sense of strategic coding (functional and class decomposition &c).And usually requires three or four supplementary prompts to get code into a state that's ready to copy and paste (and refactor some more). e.g. "Wrap that up in a class; use CamelCase for classnames, and camelCase for member names. ... &c &c.
And have also used it help me find solutions to problems that I've spent months on ("android, java: unable to connect to an IoT wi-fi hotspot without internet access when the data connection is active"; Claude:" blah blah ... use connectivityManager.bindProcessToNetwork()"!!!).
Or "C++/linux/asound library: why does this {3000 lines of code} fail to reliably recover from audio underruns".
And had some success with "find the wild memory write in this 900 line code fragment". Doesn't always work, but I've had success with it often enough that I'm going to use it lot more often.
And used it to write some substantial bash scripts that I just don't have the skills or literacy to deal with myself (long time Windows programmer, relative newcomer to linux).