ChatGPT Might Make Developers Unemployed In A Few Years
I was stunned when testing ChatGPT, and you should also test it.
by Percy Bolmér, December 7, 2022
On the 30th of November OpenAI released their new GPT3.5 trained bot, ChatGPT.
It has only been a few days since they released it so that anyone can sign up and test it, and yet it is all over the internet.
The past week I have seen ChatGPT everywhere, I decided I had to give it a try to understand why everyone was so psyched.
One of the cool new things is that the Bot now has a memory, it can no longer only answer questions sequentially, but also remember what you talked about earlier.
Let’s skip the talk, and instead jump straight into the action!
Testing, Information gathering and small talk
Let us begin by introducing ourselves and testing a few simple questions. I am currently planning on writing an article about Svelte, let me see if ChatGPT has any suggestions.
ChatGPT is optimized for dialogues, which is pretty cool because it can feel like we are chatting with a live expert on the subject.
As we can see, she is very nice and asks us if I have any topics in mind, and even offers to brainstorm with me.
In my case I do have a topic in mind, a learning tutorial for Svelte and SvelteKit, let’s tell the bot.
The bot is narrowing down some of the regular tips that bloggers get. The tips are really solid, and it feels so natural when the bot suggests them.
It is pretty amazing how the bot even gives me tips on using Svelte support for reactive data like the bot was a senior export knowing the best selling points. And I believe everything the bot wrote here is true, this is usually how a tutorial should be structured. Svelte is also known for its true reactivity.
Now, writing a blog post takes more than a nice structure, there is SEO to also have in mind. Let us see what the bot has to say about that.
Now, this is cool, because apart from other chatbots, this bot has a memory, and it can answer follow-up questions.
We can ask it about SEO and it will understand the context we are in, writing a blog post, etc, without the need to tell it.
Again, the bot has some insightful things to say about SEO. This can help, instead of spending a ton of time on google to find the best practices, it made an easy to read and use summary.Let us see if it can review the writing for us to give pointers.
Sadly, ChatGPT cannot visit our website to help us…(yet?)
Technical Assistance & Coding
One amazing thing about a Chatbot as advanced as this is that we can use it as a Subject Matter Expert. No matter the area, as long as it is trained in the field we can leverage and help us with questions we have.
I am focused on Programming and Technology, so let us see how ChatGPT can help us.
I have a question on how Svelte handles a certain file named
+page.js, I’ve reached out to the Discord channel of svelte, but no answer yet, but maybe ChatGPT can help me.
This is so amazing, the bot tells me a little bit about how it cannot answer my question, but I clarify that it is related to Svelte and then it goes ahead and gives me a super easy-to-read explanation.
The part about
+page.js defining a page component is a little wonky, but the fact that it is executed on the client side, but ALSO on the server side when statically generating application is true!
The bot can be a super helpful tutor.
Let us see if the Bot can code for us.
So asking the bot directly tells us that it can not code.
But what if we ask it a more specific question about coding?
The ChatBot suffers a little bit of bad self-esteem. It can code it turns out.
It even goes on about telling me how to execute the program.
That was a very simple example, let us ask it how to connect to the Twitter API.
It’s pretty insane, that it can so fast generate a code piece that connects to Twitter API, with an example endpoint and the explanation of how to use the piece of code generated. It even tells us a little bit about the endpoint it used.
Does the code work? Yes, it is a valid piece of code even present on dghubbles repository.
Writing code is one thing, but what if we have a bug? Let’s ask the Bot to debug some code for us.
The bot finds the correct bug, in fact, we return an int when the function expects a string. It even fixes the function for us (even though the solution is a bit wonky).
So we can’t trust the code, but let’s see if we can get a unit test to increase the trust in the provided code.
So not only did it print a valid unit test, it even explained to us how to perform unit tests in Go. This is some insane stuff.
So I’m a little bit disappointed that it didn’t use Table-driven tests, let’s ask about it.
The bot listened to us, made a new unit test, and even added three test cases for us. It also explains how the unit tests are structured and how it works.
One thing that bothers me is that the PrintStuff function does not accept an input parameter, but the bot seems to think so, let us ask the bot why it does that.
Now, this is some crazy stuff, it even performs a code review. It explains why it added the input parameter, with perfectly solid reasoning as to why. It even reasons with us that in some cases it would not make sense and that it depends on the usage.
To be honest, that answer is better than most Code Reviews I’ve gotten in my life.
Infrastructure And Deployment
Now we have a function, it makes no sense if we cannot deploy this.
Let us ask the bot for some help on how to deploy as a Lambda.
So the bot wrapped the function in the Go lambda function signature. The only thing missing github.com/aws/aws-lambda-go/lambda import with a lambda.Start call in the main function.
But who knows, maybe it works without that, and the bot taught me something today. I will have to verify that later.
Great, it tells us how to deploy using CLI or SDK, but I am more of a Terraform guy.
So ChatGPT generated a Terraform file for us with the lambda resource, but also the very much-needed lambda exec role. That is much more than I had hoped for.
Let’s see if we can push it a little further, we need some security and isolation.
So it generated a VPC and a Subnet. Now that was cool, but the most amazing part is that it backtracked in our conversation, knew about the old lambda, and modified it.
It went back, and patched the print_stuff lambda resource to add the VPC configuration to it.
Now, we need to deploy it also.
It missed the whole terraform init and configuration part, but It provides a solid answer to my question.
Maybe If I asked the question differently it would provide more context.
It does explain not only HOW to deploy, but also what the apply command will do, and how the AWS resources will be modified.
This is pretty amazing.
Now, we have a lambda and a deployment, but sometimes we need to debug the lambdas locally, maybe with AWS SAM?
Holy smokes, it creates a full AWS sam template with the lambda resource inside of it.
One final thing to test, we started the chat with a Svelte tutorial, let us ask if we can make a dockerfile for the Svelte Application that will be built.
So it creates the Dockerfile, with an optimization that is used node:14-slim because it was more lightweight. It also tells us how to run and handle the docker image, along with the URL where we can find the application once we run it.
Call me crazy, but some of these things are insane.
The dockerfile for instance, basically the Bot wrote a better readme file than most developers out there. Not only did it document why it did stuff, but it also wrote a great step-by-step how-to explaining the usage.
The code is a bit weird, but it does a really solid job generating most of what was needed.
I am not joking when I say that I will begin using the ChatBot instead of Google, there is no reason to google unless more advanced stuff. The ChatBot will be a great helper in any work I perform.
I am a bit worried though, it feels that I will need to find new employment in a few years if this goes on.
I want to say a Good job to the guys at OpenAI, this is some insane stuff going on. It will probably help us developers become much more efficient seeing as it can really help the development speed.
And, please stop developing it, I don’t want to be unemployed!
Thanks for reading my stuff, reach out to me if there are any questions or feedback!
If you enjoyed my writing, please support future articles by buying me an Coffee