š¤ Can AI Make You a Smarter Programmer?
Exploring the potential of AI tools like ChatGPT in improving programming skills.
Breaking news: ChatGPT has taken the world by storm!
Okay so not so much ābreaking newsā anymore since everybody is talking about it.
And not just talking - theyāre building like crazy! Since it was made public towards the end of 2022, almost overnight weāve seen an influx of AI-driven apps designed to make our lives easier.
Most interestingly, are the people who have been using ChatGPT themselves to be more productive. From essay writing, to marketing, making social media posts and creating SEO content - ChatGPT can do it all.
All of this makes ChatGPT the best thing to hit the internet since, well the internet!
One of the most impressive uses of ChatGPT is its ability to churn out and explain code. Itās become a useful tool in every developer's pocket. A lot of devs are now wondering how they ever lived without it. They say their productivity has gone through the roof and they can build things in hours that once took days or even weeks.
But ChatGPT wasnāt the first AI revolution to hit the world of programming. Back in 2021, GitHub released beta access to their coding AI-assistant application called Copilot. They then released full access a year later in the summer of 2022.
Copilot can be used as a plugin for your IDE that will write code suggestions for you whilst youāre coding.
GitHub describes it as:
Your AI pair programmer
Whatās important to note is that Copilotās AI technology is driven by the OpenAI Codex. OpenAI is the mastermind company behind ChatGPT, so one can say that GitHub was on to something way before we knew anything about ChatGPT.
Copilot started the hype in the developer world of using AI for programming, and developers everywhere were raving about it. I was lucky enough to have beta access to try it out for myself (whilst it was free).
And just like everyone else, I was very impressed. However, when the trial was over, I decided not to upgrade and take on a subscription, and it had nothing to do with the price.
Why I stopped using AI for programming šµ
Although I was very impressed with copilot and found it very useful in many ways. I made the decision to let it goā¦for the time being.
My decision had nothing to do with the fact that I would have to start paying for it. In fact, I thought the subscription price of roughly Ā£10 a month to be quite reasonable for what it offered.
My issue was that as an ever-growing dev, I was afraid that if I began to rely too heavily on using Copilot to write code for me, then this would hold me back from learning more important things myself.
I wanted to feel the struggle as I always had, learning through trial and error, and becoming a Google-Guru. I felt that the best way to learn was through failure and I didnāt want any shortcuts.
Then in came ChatGPT.
How I discovered the real benefits of using AI for programming ā
So I stopped using Copilot. I uninstalled the plugin and carried on my way as I always had.
And a few months later ChatGPT was ābornā. At first, I didnāt really pay much attention to it. Then suddenly I couldnāt avoid it.
Everyone was talking about it. My Twitter feed and YouTube algorithm were full of ChatGPT content, and I became massively intrigued, as Iām sure you were too.
My first thought and experiments with ChatGPT were mostly for writing. I wanted to see how I could use it to help me write content, both for this blog and on Twitter.
I then got massively into AI Art apps such as DALL-E and Midjourney. I even created my Twitter profile avatar and banner using DALL-E, but thatās another story.
I plan on writing a separate article about the awesomeness of AI Art apps in the future.
Anyways back to ChatGPT.
One day I had to complete a task of writing some documentation for a new application. Now I had never seen or used this application before. In fact, it was new, which was why they needed the documentation to guide others on how to use it.
I took a look at the code, and whilst some of it I understood, a lot of it I didnāt. This was because it was backend JavaScript and Iām mostly a frontend dev so Iām not always familiar with backend stuff.
My first thought, as it had always been, was to use Google. But after spending some time I knew it would take a long time to gather what I needed. Plus, I still needed to be able to explain properly what each function was doing.
It was then that I had the bright idea!
What if I asked ChatGPT?
So I fired it up, dropped in a block of code and asked ChatGPT to explain it to me.
To my surprise and delight, it explained it perfectly. I was able to understand what the code was doing. I mean, I had a rough idea, but ChatGPT confirmed this with clear and concise explanations that I donāt think I could have come up with on my own.
I was hooked.
From then on I used ChatGPT to explain everything I needed and even asked it add in the comments and JSdocs to the code itself and it did!
A simple example of this can be seen below:
Now I know this is a very simple example, but one thing to point out here was my use of the words āsend back as codeā. By writing that, ChatGPT will know to send back the response in a code block that I could then easily copy and edit if needs be.
ChatGPT had officially saved me hours' worth of time.
It was then that I decided to embrace AI for programming and I reinstalled Copilot and signed up for a subscription.
Once I did that, I used Copilot to help with writing better suggestions for some of the stuff that I didnāt like or agree with what ChatGPT had given me.
Between the two apps, I had increased my productivity tenfold, plus I was learning so much along the way. ChatGPTās explanations were teaching me about the code in the application I was working on in ways that would not have been as verbose with a Google search.
Whereas Copilot was coming up with the things I knew I had to write but would have taken a lot longer to figure out.
AI had indeed made me smarter: it made me work smarter.
How AI can make you a smarter programmer š¤
If youāve ever heard of the phrase āwork smarter, not harderā, then this is exactly what Iām referring to here.
The best developers will often say that to be a good programmer you just need to be good at finding solutions, and this often involves using Google to the fullest to solve your problems.
For me, AI is a game-changer in this respect. Apps like ChatGPT and Copilot make it easier and faster to get to the solutions to your coding problems.
Some ways in which AI can make you a work-smart programmer:
Code completion - ChatGPT can assist with code completion by suggesting lines of code based on your inputs and context. This can save time and improve the accuracy of your code.
Debugging - ChatGPT can help with debugging by suggesting potential solutions to errors and bugs in your code.
Automating repetitive tasks - AI can help with automating repetitive tasks such as code refactoring, which can save time and improve the overall quality of your code.
Advanced programming - AI can also assist with more advanced programming concepts such as natural language processing and machine learning.
Research Assistance - AI can also help with the research process by suggesting relevant papers, libraries, and other resources to help you further explore the topic you are working on.
So if youāre a new developer, donāt be like me and be afraid of using the technology to your advantage. Donāt think that if you use it then you could be stopping yourself from learning how to code.
Instead, use it as a tool to aid your learning. Get ChatGPT to explain the code and concepts you donāt understand. Use Copilot to fill in the gaps, but be careful and make sure you fully understand what itās spitting back. Heck get ChatGPT to explain Copilotās stuff if youāre not sure!
Work smarter, not harder.
But most importantly donāt stop learning.
From your fellow ever-growing dev,
Cherlock Code
š If you liked this article...
I publish a weekly newsletter to a community of ever-growing developers, seeking to improve programming skills, increase productivity and share knowledge within the exciting sectors of Tech, AI and Web3.
Get more articles like this straight to your inbox.
And stay in touch on š¦ @evergrowingdev