6

OpenAI's ChatGPT can write impressive code. Here are the prompts you should use...

 9 months ago
source link: https://finance.yahoo.com/news/heres-3-ways-chatgpt-write-090413012.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

OpenAI's ChatGPT can write impressive code. Here are the prompts you should use for the best results, experts say.

Beatrice Nolan
Thu, August 10, 2023, 8:07 PM GMT+9·4 min read
A software engineer wearing headphones while sitting at a desk and coding on a computer.
OpenAI's ChatGPT has caused quite a stir in the tech community.Getty/Luis Alvarez
  • OpenAI's ChatGPT has been able to produce working lines of code.

  • The AI-powered bot has freaked out programmers and caught the attention of tech CEOs.

  • Insider spoke to several experts to get their tips for prompting ChatGPT to generate better code.

OpenAI's ChatGPT has caused quite a stir in the tech community.

The AI-powered chatbot's ability to write impressive lines of code has freaked out programmers and caught the attention of some tech CEOs. Some companies have already begun incorporating the technology into everyday workflows.

Although generative AI is lowering the barriers for coding and making it easier to develop software across the board, some users are still struggling to get the desired results.

Insider spoke to several computer-science experts and tech workers who've created software with ChatGPT to get their advice for generating better code.

1. Break down your prompts and keep them simple 

When it comes to generative AI, it's all about prompting.

AI-powered chatbots respond to commands written in plain English. Much like instructing a person, it's better to be clear and concise when explaining what you want to ChatGPT.

Ammaar Reshi, who described himself as a novice coder who's used the bot to create apps and video games, said going overboard with information in prompts could skew the results.

"I like to think of GPT as someone who is half-listening to you," he told Insider. If you ask the bot to do everything at once, for example, to create an entire video game, it's likely going to make quite a few mistakes, Reshi said.

He said: "I would recommend explaining what your project is to GPT first. Approach it step by step and build those blocks with GPT, asking it how it would do things."

"I found it makes far fewer mistakes when you separated it all out because it's no longer trying to keep everything in its head," he added.

Neil Ernst, an associate professor of computer science at the University of Victoria, said the tech was a great tool to help those who lacked training get started.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK