Chatting about code

I have enjoyed programming computers since I first had access to a terminal attached to a mainframe while I was working and studying at Queensland Institute of Technology in the early 1970s. I have applied my self-taught skills to programming different devices in a variety of languages since. Most often my coding was directed toward making my work more efficient by processing student results, managing school finances, or the like.

After almost 20 years of learning to code from magazines and books, during 1989 and 1990 I completed a Graduate Diploma in Applied Computing by external study through what is now Central Queensland University. I’m reasonably confident that I understand the basics well enough to complete the projects I tackle but I have never done enough programming in any language for long enough to develop fluency. As a consequence my coding efforts have been heavily dependent on searching out elements of languages as I worked.

A few years ago I undertook a project to build a membership database for the Cri du Chat Support Group Ltd. with which we have a family connection. At the time I took it on the record of members was in an Excel spreadsheet that did not separate addresses into separate columns for street, city, state, etc. and sometimes included multiple pieces of information in a single cell. The data were separated out, cleaned where necessary, and uploaded into a mySQL database.

After some searching I borrowed code from Tutorial Republic, where I found essential files for a Create, Read, Update, and Delete (CRUD) application developed in PHP and MySQL. That enabled me to build a database with basic functionality. As I explored further I came across a CRUD variation that used code from DataTables, to present data from a database in a flexible table with controls that support exploration of the data.

Since September last year I have been working on a database used by Friends of the Escarpment Parks primarily to record work by volunteers in parks. I started by taking some files from the previous project and modifying where necessary to achieve minimal functionality before moving on to add necessary features that were different. Where there was need to display data in tables I used DataTables as a simple but flexible solution.

What was different this time around was that instead of merely searching in ebooks or the open web I used ChatGPT to assist with coding. Provided I was able to describe what I wanted to do ChatGPT seemed able to generate workable code for PHP, Javascript, or SQL queries needed for various aspects of the project. Where I had code that was not working correctly I could ask ChatGPT to inspect code that I pasted in and it typically responded with corrections and improvements to my code.

Over the past week or so I was working on reporting functions in the database. One of the users asked if it would be possible to modify a report to include a total at the foot. It did not take me long to confirm that DataTables offered that functionality and I adapted some code from the DataTables site to calculate the relevant totals but nothing appeared at the foot of the table. I dug deeper in the DataTables site and tried some more variations without success.

Eventually I asked ChatGPT. It returned code similar to what I had been using with a note to ensure that the table had a footer element. My table did not have a footer element and none of the documentation I had found in the DataTables site mentioned that. I added one using code provided by ChatGPT and voila… I had totals. In this case ChatGPT did better than the official documentation. It has certainly improved my productivity as a coder.

2 Responses

Leave a Reply

Your email address will not be published. Required fields are marked *

Post comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.