Is ChatGPT / AI really that useful? A real world example.
Artificial intelligence, or AI, is a term that's thrown around a lot these days. Some people view it with excitement and optimism, seeing it as a powerful tool that can help us solve problems and make the world a better place. Others, however, are more skeptical, worried about the potential risks and uncertainties that come with relying on machines to make decisions for us.
It's true that AI is still a relatively new field, and there are certainly valid concerns about things like privacy, bias, and job displacement. But at the same time, there are also many examples of how AI is already making a positive impact in our lives, from improving healthcare outcomes to advancing scientific research.
In this article, I'd like to share a real-world example of how AI helped me solve a problem in my software development work. My hope is that by seeing the benefits of AI in action, we can start to appreciate its potential and understand how it can be used for good.
As a developer, I know that sometimes even the most complicated and well-intentioned code can cause unexpected problems. Recently, I encountered such a problem in an application I'm working on when customers were unable to find other users by email address. Despite the email addresses being present in the system, the search results were not returning correctly due to a bug in the code.
The problem turned out to be caused by a regular expression pattern that was designed to prevent unsafe code from being included in the application. However, this pattern also prevented certain special characters, such as plus symbols and commas, from being included in the search. As a result, customers were unable to find the users they were looking for.
At first, I struggled for quite a few hour to understand and modify the complex code responsible for the regular expression pattern. I could change the code to get the result I wanted, but then it also allowed unsafe code in my codebase.
After a while, I decided to throw the problem to ChatGPT, and was pretty happy with the result.
First, I pasted in the complex code and asked for an explanation of what each part was doing. ChatGPT was able to quickly and accurately explain the regular expression pattern to me.
Once I knew what each part of the code did, I had planned on removing parts of the code, one bit at a time, and trying to get the code working. Once I saw how easily ChatGPT had answered my question, though, I decided to just ask it how I could accomplish my goal.
领英推荐
Perfect!
I tried this new solution in my codebase, but it still wasn't working... so I went back to ChatGPT and asked it why that might be the case - this time giving it more detail about the type of database I was working with and exactly what query I was using.
To this, ChatGPT responded with 4 potential reasons my code might not be working. After a little testing, #4 was clearly the reason. I told ChatGPT that was the problem and asked it to rewrite the query in a way solve that problem.
The final solution took a little finagling, but the conversation led me in the right direction very quickly and eventually got me to a working solution.
There are definite risks inherent in the adoption of new technology like AI, but I hope this gives someone out there a more concrete example of the types of problems it can solve. Programs like these are helping people like me, in this case software developers, reduce the amount of time we have to spend researching and looking at problems significantly... that eventually means more efficient coding and lowered development costs all around.
P.S. ChatGPT also wrote about 80% of this article :O
Contributing to Marketing Agencies as an Attribution Specialist and Web Developer.
1 年Haha. Love the twist at the end!