ChatGPT is an AI-powered conversational API by Open AI that generates a lot of hype and fear amongst consumers, professionals and experts alike. Depending on who you talk to, ChatGPT will either revolutionise how we work, or it’s coming for our jobs and will taint academia.
You might have seen some news stories, including the impressive feats of ChatGPT passing prestigious law and business exams. And while these stories are understandably concerning, AI is based on learning and is no different from people reading books and learning materials available online to do the same thing.
One area of concern for some is ChatGPT and AI replacing programmers. Can ChatGPT write code? Yes. But it’s not as impressive as you may think. Is AI a threat to programmers? Should we be concerned our once coveted jobs are under threat?
No, ChatGPT is not designed to replace programmers. Instead, it can assist them in the development process. ChatGPT can generate code snippets and suggest solutions based on patterns it has learned from data, but it lacks the creativity and critical thinking skills that human programmers possess. Ultimately, ChatGPT is a tool, and like any other tool, its effectiveness depends on its use.
In my testing of ChatGPT, I found it could generate code for simplistic problem-solving questions quite well. For example, ask ChatGPT to generate a Javascript function that can generate random guid strings, and it will give you code that will probably work. But, as programmers, we don’t work on tiny problems.
Here is what I asked ChatGPT:
Write me a Javascript function that can generate valid guids without using dependencies
And here is the code it created:
function generateGuid() { function s4() { return Math.floor((1 + Math.random()) * 0x10000) .toString(16) .substring(1); } return ( s4() + s4() + "-" + s4() + "-" + s4() + "-" + s4() + "-" + s4() + s4() + s4() ); }
In this situation, it generated code that works. You can take this and run it in the console inside developer tools, and it will generate a guid string in the format of xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
— impressive, but you could achieve the same thing using a library of a simple Google search.
Where ChatGPT seems to fail is more complex coding tasks. Sometimes it will comply and generate code, which will probably not be valid (unless you get lucky). Other times it will outright deny generating the code and occasionally provide bullet-point tips telling you how you might be able to do it.
ChatGPT has proved itself in its ability to write boilerplate code. Sometimes you want a primary starting point. Tasks that are simple but time-consuming. If you can offload those to AI tools, you’re saving possibly hours. Like our function above, something an experienced programmer could do, but AI can do faster. More impressively, you can even ask it follow-up questions like, “Now, write me some unit tests for this code,” and it will.
People see ChatGPT as this extraordinary genius AI that can do everything. Still, it becomes less impressive when you realise ChatGPT and all forms of current artificial intelligence are just more intelligent search engines. Think about it.
ChatGPT and all known public AI are based on publicly scraping data. Isn’t this what search engines do? When you perform a search query, it queries that data and returns a result. Where ChatGPT differs from a search engine is its ability to work with context, allowing you to ask follow-up questions or, in some cases, correct it when it is wrong.
And then we come full circle. What is it many programmers do when they get into trouble? They Google. Now, imagine if you had an AI companion; you could provide problematic code or error messages, and because it scraped the documentation, StackOverflow, blogs and other data, it could do the work you would usually do of finding a solution and prevent it to you. That’s where the true power of ChatGPT lies.
And that’s the critical thing that programmers need to understand. While it’s second nature to know what to type into Google or ChatGPT, that’s a skill you learn as a programmer. You learn what to type in to get the result you need. That’s the difference between a junior, midweight and senior developer: your ability to condense a problem down into a Google search query.
It takes skill to be a programmer. You need to know how to code and what prompts to write into Google, ChatGPT or other tools. A solution is only a sum of its parts. And while ChatGPT can handle some of those parts, many facets of programming are beyond the ability of ChatGPT.
While some hysterically decry the end of programmers, lawyers, and other industries, AI will be another tool programmers can use to be better and more efficient at their jobs.
If anyone should be concerned, it’s Google. ChatGPT and other AI tools are a real threat to Google and its search engine. It’s the reason Microsoft invested billions into Open AI and why they’re integrating ChatGPT into Bing. If people choose to use ChatGPT instead of Google, that’s one less set of eyeballs to show ads to (although most developers use an ad blocker anyways).