ChatGPT will replace software developers. Someday. But not today and not any time soon. But what it will do in the near future is increase the productivity of programmers who use it correctly.
The other day I had a task to find a set of rectangles that approximate a complex geo polygon. While working on this I had to write a function that will divide a large bounding box into smaller bounding boxes. An extremely boring thing to do, so I asked ChatGPT to do it.
I tested the function, and sure enough, it works just like I wanted. Instead of spending 15 minutes or perhaps even more writing it, I spent just about 30 seconds. The bounding box is perfectly divided into smaller boxes as you can see in the screenshot below.
And this is where ChatGPT will boost the productivity of developers at the moment—acting as an assistant writing all sorts of functions and algorithms. Why would I waste my valuable time writing uninspiring and tedious stuff when I can hand over it to ChatGPT and focus my attention on the more important stuff that AI can't do instead of me?!
As they like to say on Twitter, AI will not replace you, a person using AI will replace you. The more I use AI, the more I'm inclined to believe in this. Having such a smart assistant at your disposal at all times is a really incredible and powerful way to boost your productivity.
In some cases ChatGPT will give you a wrong answer, so always review the answer you get, go through the code, and get a sense of what it does. You should never run untested code, whether you copied it from Stackoverflow or ChatGPT. AI tools at the moment are not a replacement for human judgment and expertise.
The more I'm using ChatGPT in everyday work the more I want to explore the API and get a better insight into all possibilities. So I spent a weekend building a simple tool that helps me to analyze code and find bugs using ChatGPT API. I built this web app using React and OpenAI API in a few hours, and I plan to expand the functionality as I learn more about useful ways to utilize AI.
To show you how the tool works, I copy and pasted a code snippet that shows how to zip files in Drupal, and I clicked on the Explain code button. And here's the result:
That looks like a pretty good explanation of what the function is doing. This works well for more complex functions as well, so it's of great help when you don't want to spend your brain power unraveling tangled code.
Now let's update the same code and make a simple typo. Let's see if ChatGPT will detect the error when I click on the Find bugs button.
In order to use the application you must have an API key from OpenAI. All registered users have some free credits, so head over to https://platform.openai.com/account/api-keys and create a new API key if you already don't have one.
Once you have a key, click on the Configure API key button and paste it. The key is saved only in your browser, and it's not transferred to my server!
And that's a wrap. If you have any comments or suggestions drop me a message, and I will get back to you soon!
About the Author
Goran Nikolovski is a senior web developer who loves working with Drupal, React, and React Native. He is the founder of this website and he enjoys sharing his knowledge. Need help with anything? Get in touch.