Posted: April 7th, 2023
Updated: May 23rd, 2024
I was troubleshooting some code for a website I was working on when I came across an error. Even though the issue wasn't very complex, I was curious to see how ChatGPT would respond to it. In addition, I believed it would provide me a chance to learn more about ChatGPT's advantages for helping developers with their code. I'm going to presume for the purposes of this essay that readers are not familiar with web development technology, so I won't get too technical.
You may recall in a previous post, I wrote on the subject of whether ChatGPT will replace traditional web development, and my hope is that this article will stand as a use-case to strengthen the claims made there.
I came over a somewhat complex error message while tinkering with some coding for a website I was creating. I couldn't think of a solution, so I chose to ask ChatGPT, just like many of my colleagues. It should be noted that the error message had nothing to do with syntax or stopping the code from compiling. To put it simply, the mistake was putting a value on something that was supposed to receive a "never" response. I could have probably just disregarded the mistake and moved on, but because I'm a perfectionist at heart, I thought this was a great chance to learn more about ChatGPT. I reasoned that ChatGPT could act as a sounding board for my mistakes and a case study for my earlier article.
I pasted the faulty code into the ChatGPT prompt to fix the problem, and I received a comprehensive response that supplied an updated version of my code with what appeared to be the fix for my error.This is where the tale changes, since although ChatGPT's reaction resolved my first little problem, it also brought up a number of other ones.
In an effort to resolve the can of worms that I had now opened, I started essentially 'Pair Programming' with ChatGPT to see if doing so would resolve the error. For my non-software readers, Pair Programming is an Agile term that has to do with working with another developer to write code and is common practice in what is called 'XP', or 'Extreme Programming'. The problem however arose in that the responses from ChatGPT, rather than progressing with the conversation, became cyclical.
We were no longer progressing with the solution, but had started a cycle in which ChatGPT had no answers so continued to loop back to an earlier one. These earlier solutions notably had not worked, and so we fell into a repeated cycle, even when this was pointed out to it. The initial error, which was not major in any stretch, was now replaced by a different major issue that caused the program to no longer compile at all.
Not all solutions, it should be noted, caused errors. There was some perfectly good segments of code that were given, but they only worked because they completely negated the initial code that needed fixing. They presented a working program that simply nullified the first error code and so 'worked', but did not fix the issue.
Fortunately, through the process, my brain was able to reboot sufficient enough to realize a simple solution to the initial problem. I shared my resolution with ChatGPT, who was pleased to have been a part of the process. The resolution to my error was not fixed by ChatGPT in this circumstance, but the conversation was able to inspire another direction that I had not considered unrelated to the solutions posed.
In answer to the question posed previously, Will ChatGPT replace traditional web development? My thoughts are that they will not, at least in the conceivable future. In this scenario, the solution was found through creative means, not traditional ones. ChatGPT is an extremely useful tool for developers, but may not necessarily solve all coding problems, especially when they require a higher level of creativity to solve.