Writing code with Chat-GPT

I’m still playing with ChatGPT. It’s turning out be quite useful. Today I asked it this question:

A command group contains a name and a url value. A command group also contains a number of commands. Each command contains a name, description and url value. A command also contains a number of messages which contain a device identifier, message string, name and description. The data objects are stored in a Mongodb database. I want to edit all these items using a web page generated using Express and using Mongoose to interact with the database elements. What routes and express page templates would I need?

ChatGPT came back with a useful description of what I needed to and I was able to ask more detailed questions about specific elements of the code that it suggested. I was then able to ask for sample code for the Express pages and the route handling code. This was all very impressive. It didn’t save me a lot of work because I’ve already implemented the system as described, but it was interesting to see that it produced a design and some code that was pretty close to what I’d written.

If you need some code writing you might like to try creating a description of what it needs to do and then dropping it into ChatGPT. At the very worst at least you’ll have a good description of your problem, at best you might get something useful back.