How to become a better programmer with ChatGPT?
ChatGPT and other AI-based text applications have recently received a lot of attention and both marketers and programmers alike have found ways to use it for their own advantage. Raimo Seero, CTO at Uptime, said that while ChatGPT can be a useful tool for developers, they should be careful when using it and understand that the only way you can benefit from it, is by knowing what is right and what is wrong for yourself.
“ChatGPT can do a lot of things, but that doesn’t mean it can do a developer’s job. Yes, it can write a ready-made code snippet, but that’s not all a programmer does,” he said. “If a developer’s job was just to mindlessly write code, AI could take over their job today. But the reality is different – a developer needs to be able to look at the big picture, understand how a particular piece of work fits in with everything else, and be able to validate that the code they write actually meets standards, assumptions, and best practices.”
That’s why, he says, it’s worth looking at AI as an assistant rather than an underlying that can do all the work for someone. “ChatGPT can generate some functions, but if you can’t verify its correctness, it’s of no use. You can’t program blindly – the ability to figure things out for yourself is critical.”
However, if you are skilled enough – or can admit to yourself that AI is only used for learning and that the code you create with that doesn’t make you a developer – ChatGPT can be a very useful resource. This is especially true when you’re just getting acquainted with the development world, or if a problem comes up that you don’t want to spend too much time on.
So how can you make the best use of ChatGPT?
Ask for help
Solving problems is part of a developer’s job. Whereas you would normally type a problem description into Google, you can now turn to ChatGPT for ideas – the more specific the question, the more help you can expect. For example, AI can be a great help if you’ve forgotten exactly how to build a particular function in a language, or what the names of certain parameters are. Likewise, it can be of great help when you’re weighing up between two different approaches: it can highlight the pros and cons of both, so you can make an educated decision.
Debugging
ChatGPT is quite good at debugging code or providing solutions to error descriptions. If you show it a snippet of code that throws up red exclamation marks or describe the nature of a particular problem, it can suggest ways to solve the problem. These solutions may not always be exactly what you need, but they can still help point you in the right direction.
Formatting
Most developers format their code as they write it, but for one reason or another, you may come across a poorly readable or unevenly written repository. ChatGPT can be asked to reformat it according to best-known practices. It is not difficult to do this yourself, but the opportunity to save time is always welcome.
Practice
When learning programming, practice, and problem-solving is critical, and it is useful to see how another developer would approach the problem. ChatGPT can be a good sparring partner for this. Once you’ve solved a problem and are happy with your results, you can ask an AI to solve the same problem – they’ll probably approach it differently than you, and while either way might be right, it helps to broaden your perspective and pick up ideas you might not have thought of before.
A bit of busywork
There are a bunch of small jobs in every development project that don’t require so much thought, but rather a bit of busywork. If the skills are there to validate the quality of the code, some of these tasks can be handed to the AI – for example, asking it to write code in a particular language to pick the month and year out of the date, or to make all the round boxes square in a particular section. When doing this, however, it is extremely important to be able to judge the quality of the work done.