OpenAI’s artificial intelligence chatbot can be an incredible resource for developers who know the right prompts to ask. Since the AI version will continue to evolve (GPT-3, ChatGPT, GPT-4, and so on), we’ll simply refer to it as “ChatGPT” throughout this guide.
The ability to structure the type of answer you want is an important step often overlooked. Let’s say you’re looking for inspiration on writing technical documentation. You can begin by telling ChatGPT:
Before I ask my question, let’s set the stage: you are an experienced developer writing documentation for others to learn from. Your answers are professional and will include: an intro summary, a code example, and
a bullet list of best practices.
You’ll see a reply similar to, “Great! I’m ready to assist.” At this point, you’re free to proceed with an additional prompt related to development and the generated output will follow the style as outlined above.
You can also specify how you’d like the output of ChatGPT’s answer to be formatted. For example:
In a table with four columns, one for color names, another for hex values, one for RGBa values, and a final column for descriptions, list the most commonly used colors in websites.
Taking this one step further, you could then create an easy way to copy-paste that table elsewhere by following up with this prompt:
Repeat the last answer formatted as markdown in a copyable code block.
Have you ever asked ChatGPT for a lengthy answer that seemingly gets cut off? There’s an easy fix to that, simply follow-up with the word Continue in your next prompt and it will carry on with the previous reply.
Did you know you can paste your own code snippets into ChatGPT? This is especially helpful when tracking down a stubborn bug. All you need to do is begin your prompt with something like:
In the following code, why is it generating [fill in the blank] error?
And then hit shift + enter on your keyboard to drop down to the next line in your prompt and paste your code snippet in. Of course, you should never share code that might contain sensitive info so be mindful of that.
After your initial question to ChatGPT, there are useful ways to extract even more from the original answer. Here are some of our favorites:
This article was originally created for subscribers to the design.dev newsletter. Subscribe today to get additional content like this, as well as a set of 300 custom icons 🙌
Help @designdev spread the word by sharing this article on Twitter...Tweet This