Generative artificial intelligence describes algorithms (such as ChatGPT) that can be used to create new content, including audio, code, images, text, simulations, and videos. Recent breakthroughs in the field have the potential to drastically change the way we approach content creation.
AI research has been around for about 80 years, however, conversational AI that is capable of carrying out an intelligent conversation with a human has always been difficult to master. It is for this reason the recent ChatGPT developments have caused quite a stir.
Who can explain what ChatGPT is better than ChatGPT? I asked it to tell me what it can do? It replied with:
“ChatGPT is a language model that can perform a wide range of natural language processing tasks, including text generation, completion, classification, translation, question-answering, summarization, and chatting. It can understand and generate human-like language, making it a versatile and powerful tool for various language-related tasks.”
I felt this was a bit bureaucratic, so I asked it to explain in simpler terms…
“ChatGPT is a computer program that can understand and generate human-like language. It can do things like write paragraphs, answer questions, and translate languages. Think of it like a really smart language robot that can help with many different language tasks.”
I was not sold so asked it to pitch itself to me!
“ChatGPT - the ultimate AI language model that can help you accomplish various tasks effortlessly! With its advanced capabilities, ChatGPT can answer your questions, generate text in different styles, translate text, analyze sentiment, summarize long texts, hold a conversation, write creatively, and conduct research. Whether you're a student, researcher, writer, or just someone who needs quick and accurate information, ChatGPT is your go-to solution! With ChatGPT, you can save time, increase productivity, and get ahead of the competition.”
Do you find anything off or odd in these paragraphs? Because I couldn’t, which is the scary thing. It’s fluent, it doesn’t feel like it’s cobbled together; it has an idea that goes from start to finish in an eloquent way.
As someone who is not a native English speaker, ChatGPT may well do a better job at writing copy in many cases.
The world was fascinated by the recent developments. Its social network reached 1 million followers quicker than any other social media channel before it. People have an appetite to see what it can do. That, or a morbid curiosity to understand something that could make us obsolete.
Whatever people’s interest, it’s made waves in several industries with differing opinions. Some wondering if the robots are finally coming for our jobs; and others realising the potential to streamline processes that help us to do our jobs quicker and more efficiently. But, what about our industry? Can it create code better than those of us who have spent many years learning, experimenting and perfecting? I put it to the test.
I had a request come in from our People team who were implementing a new HR system called BambooHR. As part of the recruitment process, they wanted a way to import the current candidates into the new system. Importing large amounts of data into BambooHR is not possible, but they had an API to push the data to. So as a coder, I thought let’s give it a try. I wanted to write a simple piece of code to read the database as a CSV file and push it Bamboo’s API.
My code of choice is C# (C-Sharp), so I added in the prompt “write a c# program to parse a csv file with the following columns.” And it began writing my code for me.
I didn’t say anything about recruitment, but it understood from the data that we are talking about recruitment records. I also didn’t give it the seniority information, but it generated those (junior, mid senior) too.
I then asked it to change the first response property to a nullable date. It understood the context and started to generate the code again. I now have the data and the logic to import it into memory.
I then ask it to write a service to push RecruitmentRecord object to BambooHR’s API. It doesn’t use any libraires, it just uses the HttpClient, sets the authorisation and gives us the explanation.
I request to make it testable. The response – “to make the ‘BambooHRRecruitmentService’ testable you can use the dependency injection to inject the HttpClient into the service. Here’s an updated version of the service that uses dependency injection.” It gives me the unit test for the method as well.
I had a look through the code to check its handiwork. ChatGPT had generated what was asked of it, however, there were some areas that would need to be checked as it may be using something it has seen before, BambooHR may not necessarily have some of that particular information in its API.
There is still a bit of validation that needs to go into it, but I was impressed. It took five minutes to generate 90% of what I needed.
If ChatGPT can do this on version 3, what can version 4 do? And what does this mean for the future of our industry?
While ChatGPT has a basic understanding of programming concepts and syntax, it is not a dedicated code analysis tool and may not be able to identify specific coding errors or bugs.
There are other AI tools and software available specifically designed for code analysis and bug detection. These tools use various techniques, such as static analysis, dynamic analysis, and machine learning, to identify potential bugs and issues in code.
Whilst such AI tools may be able to help enhance what you already do, they should never be solely relied upon for fully accurate results, a combination of manual and automated testing is guaranteed to give you the best performance and output.
How does it affect us as developers and knowledge workers? Can we leverage it to do our jobs faster and better?
I believe it can speed up processes and improve on what is already there. It can also help with minor ‘boilerplate’ code.
However, ChatGPT should be used with consideration as there could be issues down the line with intellectual property (IP) and adhering to coding standards. As code generated is based on the input provided by users, the ownership of the input remains with the user, BUT the output generated by ChatGPT, including any code or text generated, is the property of OpenAI.
ChatGPT is also not designed to specifically adhere to any particular coding standards or best practices, and the quality of the generated code may vary based on the input and the complexity of the problem. Therefore, it's important to review and test the code generated by ChatGPT thoroughly, and to apply appropriate coding standards and best practices as necessary.
If you are using ChatGPT to generate code, it's essential that you have a basic understanding of coding standards and best practices to ensure the generated code is not only high quality but also meets your requirements. You may need to review and modify the code generated by ChatGPT to conform to any specific coding standards.
Whilst the recent developments in ChatGPT are incredible to see and a huge next step in the future of technology, there are still issues surrounding ownership of IP, accuracy of code and adhering to coding standards, which are significant factors for tech businesses delivering quality projects for clients.
AI presents a lot of ethical and philosophical questions, especially when it starts to do things better than us. The real test will be what happens when AI starts doing things better than a human, being more human than a human?
Currently, ChatGPT is still a little rough around the edges and sometimes boldly claims things that are not true. However, it’s interesting where we find ourselves with technology today. As someone who lives and breathes everything tech, I think we should embrace it rather than fear it. AI tools are here to stay, we just need to adapt and leverage it to our advantage both professionally and personally.