paint-brush
ChatGPT - Debugging is the new Coding!by@oliveremeka
7,717 reads
7,717 reads

ChatGPT - Debugging is the new Coding!

by Oliver IfediorahApril 13th, 2023
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

ChatGPT is a new conversational AI bot from OpenAI. The bot can be used for tasks like conversing, writing, looking up meaning and even coding. The author tested ChatGPT to create a simple calculator app with flutter. The app worked but the UI was quite poor and when he decided to add, subtract, multiply or divide any number, it didn't show any result.
featured image - ChatGPT - Debugging is the new Coding!
Oliver Ifediorah HackerNoon profile picture


Introduction

The AI revolution is on and everyone is feeling it!


Prominent among AI events is the most recent tool that is buzzing around the internet, celebrated by both tech-savvy people and non-tech-savvy individuals alike. This is none other than the recently released conversational AI bot from OpenAI, known as ChatGPT. This generative AI bot has gained prominence as people around the world trip over themselves to use it like a new global toy for tasks like conversing, writing, looking up meaning and even coding.


As a tech professional, I was attracted by this recent AI craze and decided to find out what Chat GPT is truly capable of. Also, it wasn’t just curiosity that drove me; having invested a lot of time and resources into learning how to code, it was quite scary that a new bot will just come into town and begin to take away much-desired coding jobs. That was not a very pleasant thought.


So I set out to investigate, half wishing that the bot would be a big failure in coding.


After logging in to the ChatGPT website, the UI seemed rather simple and innocent looking. Not like I actually knew what to expect, though; an interface decorated with menacing-looking bots with fiery red eyes, smiling devilishly as they trampled on workers?


Well, I may have seen too many AI doomsday movies.


However, the site appeared rather too normal for something that was causing all that excitement and worry around the world.


So, I initiated a simple conversation with the bot. Just something casual. It replied impressively, which annoyed me, so I turned the conversation up a notch. ChatGPT should be failing my questions!


I switched to riddles and math problems, asked it questions about what I had told it before and even intentionally tried to trick it. To my surprise, the bot actually proved to be quite intelligent. Well, that’s not really my problem I thought. That’s for writers to worry about.


Doesn’t matter how many words this bot can beautifully weave together; the main question on my mind was:


“Can ChatGPT really code?”


Creating a mobile app with ChatGPT

I was working a lot with Flutter at the time so I decided to test ChatGPT’s coding skills by requesting it to code a mobile app in Flutter. I asked it to create a simple calculator app with

Flutter. The bot immediately went to work and started generating flutter code on a black background (different from the normal white background it had been using for textual replies).


After a minute or two, the bot stopped generating code. I assumed it was done and started going through the code. Overall, the flutter and dart code it generated was okay. The logic was mature, the variables were well-named and the overall structure was alright.


However, on getting to the end of the code, I realized it was incomplete! This was surprising, however excited I was to have found a fault at last. I copied the code, created a Flutter app startup file in my VS Code and pasted the code I copied into the main.dart file. Truly, it showed a syntax error due to incomplete code.


I returned to ChatGPT and requested that it complete the code. Surprisingly the bot apologized and continued with the code till it was complete this time. Then I pasted the remaining code in my VS Code and ran the flutter pub get command to update any dependency in the code.


When I ran the app on my emulator, it actually worked but the UI was quite poor and when I decided to add, subtract, multiply or divide any number, it didn’t show any result.


Seemed like ChatGPT still had a number of things to learn about coding.


Debugging ChatGPTs mobile App


After testing the bot on a couple of other apps, I decided that the bot was struggling to figure out all the basic requirements of an app that an experienced developer would easily know. However, the more detailed I got with my specifications, the better it was at writing the code. But the UI it generated was never really impressive.


I always had to fix a thing or two to get the app looking good and working as needed. But it did a significant amount of the work by generating much of the boilerplate code that would have taken some time to write.


To conclude:

There has been much hype over the capabilities of AI tools like ChatGPT to carry out various intellectual tasks like writing, painting, doing calculations, and, most recently, coding. Writing code seems to be the rather more interesting capability as it is quite a complex intellectual process.


Much has been said about ChatGPTs ability to code but in my experience, ChatGPT is only as good a coder as the programmer guiding it to write the code. So, to answer the burning question of whether the bot will take away coding jobs from software developers, I end with the following takeaways;


  1. ChatGPT is still dependent on software developers to generate good code.

    The fact is that anyone who knows nothing about coding cannot really use ChatGPT to build standard software.

  2. ChatGPT cannot really test its own code.

    Building software goes beyond just writing code. It also includes testing the code and making corrections in a generally complex process known as debugging. ChatGPT just generates code but doesn’t really prove that it works.

  3. ChatGPT cannot maintain software for a business.

    After building software, developers also deploy the software for public use and make updates and corrections based on user requests. This is known as maintaining software, and this is beyond the capabilities of ChatGPT.


In summary, asides from ChatGPT, a number of easy-to-use tools (e.g., drag-and-drop UI tools) have been released in the past to replace the coding process, but none has really been able to accomplish this. ChatGPT is not different. Though there may be major updates to the bot in the future, it only appears to be a productivity tool to enable developers to code faster.


The bot may get more sophisticated eventually. But for now, ChatGPT just generates code and developers have to debug this code to create standard software.


Debugging is the new coding!