Why ChatGPT Won’t Replace Coders Just Yet

Clive Thompson on 2023-03-21

The “bullshit” problem turns up in code, too

Photo by Joshua Reddekopp on Unsplash

Lately I’ve been seeing people using ChatGPT to write code. One guy posted on Twitter about how he used it to make a simple version of Pong “in under 60 seconds”, while another had it write a Python script to rename files.

I wanted to get in on the action, so I asked ChatGPT — the March 14 version — to make a simple to-do list web app. I started off with this request …

I’d like to make a simple to-do web app. Show me the code that would do the following: Display the text “My To-Do List” at the top, with a field beneath where I can type in to-do items. When I type in a new item and hit “enter”, the new item would appear in a list below the input field. When I click on any list in the item, it disappears.

Presto — it cranked out some simple HTML and Javascript, which did exactly what I asked for.

Over the next few minutes, I added a bunch more requests: I told it to add a button called “Save List” that, when you clicked it, would save the list locally on your browser. I told it a couple of Google fonts to use, and asked it for CSS styling to use those fonts. Then I had it add a bit more styling: To change the font size for smaller screens vs. bigger screens, to add bullet points before each item on the list, and to add a light gray dotted line around the input box. Each time I asked for a revision, ChatGPT would tell me where to cut and paste the new code, and what the code was doing.

The whole shebang took barely 15 minutes, and the final version is here, hosted on Glitch, so you can try it out. (You can also see the code here that ChatGPT generated.)

Yep, I paid my credit cards

It wasn’t quite perfect! ChatGPT’s first attempt to add bullet points didn’t work, and I had to ask again. Then, when I asked it to add font-size-changing styling, it seemed to forget about my earlier request to give the input box a gray outline … so that stuff vanished from the code. It’s also not clear this would have worked so well for a layperson. I’m a hobbyist coder, so I knew how to phrase my requests so they…