ChatGPT: Working together With an AI

ChatGPT: Working together With an AI blog image

Posted: April 7th, 2023

Key Takeaways

  • Why did I use ChatGPT?
  • The Scenario
  • Limitations experienced
  • The Resolution

Why Did I use ChatGPT?

I found myself debugging an error in some code for a website I had been working on. It wasn't a complicated error, but I wanted to see how ChatGPT would handle it. I also thought it would provide an opportunity to better understand the benefits of ChatGPT in assisting developers with their code. For the purposes of this article, I'm going to assume that those reading are not fluent in web development technologies and so will spare the technical talk.

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.

The Scenario

While working on some code for a website I was building, I found a fairly nuanced error message. I was drawing a blank for solving it and so decided to do as many of my colleagues do and ask ChatGPT. The error message, it should be pointed out, was not one that prevented the code from compiling, nor was it syntax related. For simplicity, the error had to do with assigning a value to something that expected a 'never' response. I could have probably ignored the error and moved on, but I'm a perfectionist at heart and decided this was an excellent opportunity to explore with ChatGPT. My thinking being that ChatGPT could serve as a sounding board for my errors and a case study for my earlier article.

To resolve the issue, I pasted the problematic code into the ChatGPT prompt and was met with a detailed answer that included a modified version of my code with the supposed solution to my error. Here is where the story takes a turn as the response I received from ChatGPT was able to solve my initial small issue, but presented several more. 

Limitations Experienced

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.

The Resolution

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.