How to use ChatGPT to write code

David Gewirtz/ZDNET

One of the more intriguing discoveries about ChatGPT is that it can write pretty good code. I tested this out last month when I asked it to write a WordPress plugin my wife could use on her website. It did a fine job, but it was a very simple project. 

How can you use ChatGPT to write code as part of your daily coding practice? That’s what we’re going to explore here.

What types of coding can ChatGPT do well?

There are two important facts about ChatGPT and coding. The first is that it can, in fact, write useful code. The second is that it can get completely lost, fall down the rabbit hole, chase its own tail, and produce absolutely unusable garbage.

Also: I’m using ChatGPT to help me fix code faster, but at what cost?

I found this out the hard way. After I finished the WordPress plugin, I decided to see how far ChatGPT could go. I wrote out a very careful prompt for a Mac application, including detailed descriptions of user interface elements, interactions, what would be provided in settings, how they would work, and so on. Then I fed it to ChatGPT.

Also: Okay, so ChatGPT just debugged my code. For real.

ChatGPT responded with just a flood of text and code. Then it stopped mid-code. When I asked it to continue, it vomited out even more code and text. I requested continue after continue and it dumped out more and more code. But… none of it was usable. It didn’t identify where the code should go, how to construct the project, and — when I looked carefully at the code produced — it left out major operations I requested, leaving in simple text descriptions stating “program logic goes here.”

Also: How to use ChatGPT: Everything you need to know

After a bunch of repeated tests, it became clear to me that if you ask ChatGPT to deliver a complete application, it will fail. A corollary to this observation is that if you know nothing of coding and want ChatGPT to build you

Read More... Read More

ChatGPT is a new AI chatbot that can answer questions and write essays

Sam Altman, co-founder and chief executive officer of OpenAI Inc., speaks during TechCrunch Disrupt 2019 in San Francisco, California, on Thursday, Oct. 3, 2019.

David Paul Morris | Bloomberg | Getty Images

For his day job, Tobias Zwingmann is the managing partner of RAPYD.AI, a German consulting firm that helps clients make use of artificial intelligence. On the side, Zwingmann teaches online courses on AI.

Lately, Zwingmann has been generating lecture notes using ChatGPT, a new chatbot that’s quickly become the latest fad in tech. Zwingmann said he recently asked ChatGPT to explain the mechanisms and workings of a machine learning technology known as a DBSCAN, which is short for density-based spatial clustering of applications with noise, because he is too “lazy to write it all down.”

related investing news

CNBC Pro

“I went up and said, ‘OK, tell me a detailed step by step of how the DBSCAN algorithm works,’ and it gave me that step by step,” Zwingmann said.

After a little bit of polishing and editing, Zwingmann said the lecture notes were in good shape.

“This took me like 30 minutes, and before that I would have spent the whole day,” Zwingmann said. “I can’t neglect that this has proven to be hugely beneficial.”

ChatGPT debuted in late November and has quickly turned into a viral sensation, with people tweeting questions, such as “Are NFTs dead,” and requests like, “Tell a funny joke about the tax risks of international remote work.” They include a screenshot of ChatGPT’s response, which often — but not always — makes sense.

The technology was developed by San Francisco-based OpenAI, a research company led by Sam Altman and backed by Microsoft, LinkedIn co-founder Reid Hoffman and Khosla Ventures. ChatGPT automatically generates text based on written prompts in a fashion that’s much more advanced and creative than the chatbots of Silicon Valley’s past.

In a year that’s turned into a dud for the technology sector, with mass layoffs, wrecked stock prices and crypto catastrophes dominating the headlines, ChatGPT has served as a reminder that innovation is still happening.

Tech layoffs double from October to November as DoorDash cuts headcount

Tech executives and

Read More... Read More