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