ChatGPT as a Virtual Coding Assistant: Promises and Pitfalls

21

October

2023

No ratings yet.

One of the greatest strengths of ChatGPT is to write code in any coding language imaginable. Harvard Business Review argues that today there is no need for IT professionals to design and build new applications (Davenport et al., 2023). But how do I make use of ChatGPT as a coding assistant properly? What issues can I expect? How can ChatGPT be used for debugging and what potential does it offer when integrated directly into programming environments? Those are the questions I want to explore in this blog post.

ChatGPT on its surface is simple. If I ask it to write code that performs a certain task in a certain language I will receive a reasonably good answer. The suitability of the output code is primarily dependent on the quality of the prompt and the context of the coding problem provided. I need to make sure to formulate my problem statement clearly with all necessary context. To further improve the interaction, I ask ChatGPT to explain the code it writes and provide excerpts of my datasets and descriptions of relevant variables so it can tailor the code to the specific data structure. By doing this it can also use the correct variable names and support the first interpretation steps.

However, several pitfalls need attention. First, ChatGPT’s answers are constrained by token limitations, meaning a code snippet might get cut off if it’s too long. Second, there’s no guarantee the code will be syntactically correct or optimized for my specific environment. As ChatGPT as of today still has a knowledge cut-off in 2021, it may also use outdated practices. Therefore it can only serve as a starting point and always has to be improved upon.

Luckily, ChatGPT can not only help with writing code but is also a great tool for debugging code that has been tested in your specific coding environment. Most issues can be resolved by simply pasting the code and error message into ChatGPT and following the resulting recommendations.

Now imagine a future where ChatGPT or similar AI models are fully integrated into your coding environment. Real-time code suggestions, automated debugging, and even code optimization suggestions are all not far-fetched. This level of AI integration could overcome most of the pitfalls discussed earlier and dramatically alter the nature of coding, making it faster, more efficient, and even more accessible to those without formal programming education. What do you think? Let me know.


Davenport, T. H., Barkin, I., & Tomak, K. (2023, September 1). We’re All Programmers Now. Harvard Business Review. https://hbr.org/2023/09/were-all-programmers-now

Please rate this

2 thoughts on “ChatGPT as a Virtual Coding Assistant: Promises and Pitfalls”

  1. Hi Fabian,

    Nice blogpost!

    I think the integration of AI models into coding environments has the potential to be a game-changer. It offers many benefits but also raises questions about how we adapt to this era of programming. It has the potential to revolutionize software development in many ways. Such integration could definitely democratize coding which makes it more accessible for individuals without formal programming education. This could open up more new possibilities.

  2. I feel very connected to the explanation you provided in your Blog since I experienced it closely while doing Assignment 1 of our Research Methods Course where we had to learn to code in R studio. Before this assignment, I was just a novice in R studio, and I tried to use Chat GPT every time I felt stuck with the code. I can confirm that it was especially beneficial in the cases where I made a small mistake within several lines of code. For those scenarios, I would ask ChatGPT to correct it, and just like you mentioned a correct solution was provided.
    Nevertheless, those times when I had almost no clue how to code a specific analysis or graph in R studio ChatGPT didn’t result to be very helpful. Solutions were provided, but I suppose that due to my novice experience in R studio, I could not formulate proper prompts for the results I wanted to achieve. And for those times when a proper solution was formulated, it was like practicing an old Exam for an upcoming exam with the answers already written. The temptation to look at those is too high, and you end up not learning anything despite believing you do.
    Overall, I wouldn’t recommend the use of ChatGPT if you are a novice in coding and you are trying to learn R Studio. I just would recommend its use for checking small errors in your OWN written lines of code, just as you mentioned in your Blog.

Leave a Reply

Your email address will not be published. Required fields are marked *