Theoretically it should be possible to ask ChatGPT now to give you a simple chat program that uses the OpenAI API.
But unfortunally that won’t work 100% of the times.
For example it might confuse how to use packages of other developers when the developers of thoose packages changed them.
This happens quiet often and it is one of the main problems we will run into when letting AI write code.
That’s why we need to add more context - which requires a little research from our side. You can try to prompt code when you don’t know how to code it manually but it is pretty hard.
So what we do. We first learn the concept. That enables us to describe how ChatGPT should write the code.
Or to be more precise - we ask ChatGPT to explain the context - we can totally ignore the context then and instead start calling it names -
like “wth - you really think this is how a pro would do that?”
By now you should have already seen that programming is a pretty toxic trade. That comes mostly from the fact that every developer thinks about themselves that they are the greatest developer that has ever existed combined with expectations of customers who think we can just magically let the computer do whatever we want - another thing that you should have seen already - while in reality it is anything but that (installing an IDE, creating an openSSL key, creating a github account, this list goes on infinitely… this most likely is at least 25% of a developers job).
So because it is like that you have to get into the same mood. This helps us to let the model understand us better. Yell at it, like project managers do. Call it names so it starts fearing us. Etc…
Just kidding. Actually by prompting:
“wth - you really think this is how a pro would do that?”
We tell the model to enhance the code.
A nice
“how can we enhance this?” and a follow up “yeah cool implement that” works too - but it’s two prompts
One more thing if you really don’t care what that model tries to explain to you (don’t forget the model is the coder not us) is adding
“just the code - complete - but without any comments or explanations! JUST THE F**** CODE!!!”
Then you copy the code to your hello world program and restart the docker container (I am sure you figure out how to do that).
Did not work? Well, copy the error messages from your terminal into ChatGPT or google and read what they think might be the problem.
That’s it for the start. Next time I’ll post how to enhance this strategy. But you should get through it to understand it.