Sourcing useful ChatGPT coding prompts to feature

This is one of the simplest and most effective prompt techniques, even beyond just coding, just add this at the bottom.

ask questions as needed

Often I am surprised by some of the insights the AI has that were overlooked by me or that need some refining in the prompt to get the code I seek and not code that needs to be changed because of an oversight.


Depending upon the model, which may try to create a full reply and also ask questions, a modified from might be needed.

Ask questions as needed; avoid creating a full reply until all of the questions have been answered.


One other caveat with this is that with some Chat bots, they have an educational mode that is designed to ask you questions rather than giving you a direct answer. In such cases adding ask questions as needed to the prompt just puts the conversation into an endless loop of questions so in that mode it is best to avoid this prompting technique.


I noted this awhile back in a separate topic but it does apply with coding.


Bonus section:

  1. If you are working with a specific programming language and only creating code, then turn off Web Search and give the link to the documentation page for the correct version. At times web search will find inaccurate information, when the correct information is in the official documentation. So don’t allow the AI to find the inaccurate information and instead just tell the AI were the accurate information is located.

  2. When new AI models are released they are often accompanied by a System Card.

    Read the System Card as they often contain useful details. Sometimes the model requires a new way to think about how to write a prompt, so knowing this and knowing how to modify prompts for the new model can save you a few days.

1 Like