Key Takeaways

  • ChatGPT can help improve coding skills by providing code snippets and breaking down complex concepts for better understanding.
  • Treat ChatGPT as a coding companion, not as a standalone tool, to document, debug, and enhance code efficiency.
  • Understand ChatGPT’s limitations; it can assist with basic coding tasks but may not handle complex scripts well. Be specific in your queries.


The internet is abuzz with tips on improving your programming skills with ChatGPT. A few people are skeptical—and for good reason—that an AI could help them code. This might be an excellent place to start if you want to know how to improve your coding with ChatGPT.


Is ChatGPT Any Good for Coding?

ChatGPT can be powerful as a tool. It can develop more efficient methods of doing things and even give you a heads-up when needed. However, it’s not a human, and you should be wary about what it tells you to do.

ChatGPT can hallucinate vividly and sometimes has trouble recalling things that it just gave you. This is even worse when considering using two approaches to get the same result. It isn’t intelligent enough to know which one of the options you choose to go with, so you’ll have to “label” it.


GPT can serve as a “code companion” to developers. Many of us know that sometimes, we miss tiny details, and GPT can help keep us aware of those details. If you’re a new coder, you can ask GPT questions to help you understand complex concepts and break those down into more digestible bits.

More experienced coders can use GPT to look up things they might have spent hours scouring forums. I remember learning a new way to do a wave-function collapse algorithm from ChatGPT after spending almost eleven hours (!) looking for a simple explanation online.

GPT is also really great at giving you code snippets. For example, the prompt, “How do I Sort an Array in Python,” provided us the following code block:

A piece of code written in Python that sorts an array.


“How can I implement a binary search in Java?” gives you this:

A piece of code written in Java that does binary search on a list.

When prompting ChatGPT for snippets like these, be succinct. Don’t combine more than one idea at a time, and specify the language.

Using ChatGPT to Document and Debug Your Code

One of the big problems that coders run into when trying to improve their coding using ChatGPT is that they treat it like a piece of software. Well, sure, it IS a piece of software, but it’s far more helpful if you treat it like a fellow coder.

Documentation is a huge hurdle for many coders (mainly self-taught ones). GPT can give you good suggestions for documenting your code.

Here’s an example of how you can use ChatGPT to document code:


A linear search function written in Python with descriptive comments between the code.

If you think a snippet of code could be improved, try feeding it to GPT and see if it can make your code more efficient. This works better for small snippets than for entire scripts. If a bug shows up, you could use GPT to help you debug it. This usually works for syntax bugs, and you’ll have a much harder time chasing down runtime bugs with ChatGPT. In case you’re confused, we previously covered the different types of bugs you could run into.

GPT Can Make Learning a New Language Easier

You might run into a few roadblocks when learning a new programming language. Sometimes, the standards for a language might change. Other times, concepts like object-oriented coding might be hard to understand. GPT can break these complex concepts down and make them easier to understand. It is also superb at giving you practical examples to try.


Another excellent way is to ask ChatGPT to provide you with coding challenges in that language. It will examine your actions and guide you on the right path. The upside of using GPT this way is that it will usually nudge you towards industry standards. This makes your self-taught coding better in some employers’ eyes.

Tips for Using ChatGPT for Coding

If you want to use ChatGPT as a coding partner, here are a few things to keep in mind:

  • Be specific: Tell ChatGPT precisely what you need help with regarding your queries. The vaguer the question, the worse the AI’s response will be.
  • Verify generated code: GPT is excellent at writing code quickly, but it has issues with the details of the code. Check whether ChatGPT’s giving you code you can use and not calling any functions that you (or it) haven’t written.
  • Understand ChatGPT’s Limitations: GPT can write code quickly and help you comment or refactor it. However, it’s not so good at developing complex scripts or linking multiple scripts. It’s a good code assistant but not a magic bullet to solve all your problems.
  • Give context: AI can’t read minds (yet), and because of that, you need to tell GPT exactly what you mean when you give it something to work with.


ChatGPT Has Some Flaws…

One of the things you’ll realize when using ChatGPT for your coding is that it has a few flaws. First, ChatGPT is trained on a massive dataset encompassing thousands of lines of code from all over. It doesn’t have any context built into its system.

I’ve personally seen some situations where GPT would give me a call for a function that doesn’t even have a definition attached to a particular type, for example:

ChatGPT giving false programming information as the output.

Another thing it often does is give you a generic answer to a specific question. For example, I’ll ask it for a list of items, and it can give me the code to list and recall those items easily. However, if I ask it to take that list of items and create an inventory with drag-and-drop properties and equipment types tied into it, it’s probably not going to give me anything coherent.


The best way to think of ChatGPT is as a coding assistant. It can give you the most basic ideas you need, but it can’t combine them into anything useful without your guidance. Furthermore, it will provide snippets with a few errors, and it’s up to you to know WHY those errors are there and solve the problems that produce them.

Ideally, you want to use GPT to store a lot of information in one place. Coding with ChatGPT can be time-consuming and frustrating, but you will learn from it if you don’t quit halfway through the process.

Can You Improve Your Coding With ChatGPT?

If you use it often enough, ChatGPT can significantly improve your coding. However, you shouldn’t use it as a replacement for learning how to code. GPT doesn’t always conform to industry standards and often produces inefficient code.

It would be best if you used ChatGPT more as an assistant than a teacher. It’s great for teaching you the basics and getting some concepts down, but if you’re already a bit experienced, it’s likely to get you frustrated trying to make it do what you want.


Source link