My country:

ChatGPT as a coding assistant

What inspired or motivated you to use this tool/resource?

The motivation to integrate ChatGPT into my coding teaching came from noticing that while students managed well in the classroom, with direct support from myself and demonstrators, they often struggled when applying their skills to novel problems outside of this environment. I regularly use ChatGPT in my own work to code more efficiently, so it seemed both sensible and authentic to share this tool with students. It helps me brainstorm different approaches, troubleshoot errors, and refine my code – tasks that learners often find difficult. I thought ChatGPT presented a potential opportunity to reduce students’ frustration with simpler tasks, making coding in R feel more approachable and manageable.

What was your aim in using this tool/resource? 

The aim was that students would become more independent problem-solvers, better equipped to handle coding challenges without immediate guidance. De-bugging and sourcing unfamiliar bits of code is a key part of coding, but can be an intimidating aspect for learners. ChatGPT had the potential to act as a personal coding assistant, guiding students through these challenges and offering insights into how they might approach unfamiliar problems. By integrating ChatGPT into computer practical sessions, I hoped to build their confidence in tackling unfamiliar tasks, knowing that they had a kind of ‘personal tutor’ to help when they encountered roadblocks.

Overall, using ChatGPT helped progress towards this aim. The tool’s ability to provide immediate feedback, suggest alternative approaches, and explain concepts in simple terms made it a useful resource for promoting independent learning. One session is not going to suddenly turn all of the students into confident independent coders, but it certainly took a step in the right direction for many.

What did you use the tool/resource for?  

I used ChatGPT in a computer practical session for first-year undergraduate students from a range of science degrees, learning R coding. In this session, students were tasked with completing several coding challenges they had not previously encountered. These included creating and formatting high-quality plots and running unfamiliar statistical tests. The goal was to simulate real-world problem-solving scenarios, where they wouldn’t necessarily have experience using the exact code they needed to use, and would have to solve error messages by themselves.

Students were encouraged to use ChatGPT to help them navigate these challenges. They were asked to input their questions, experiment with prompts, and copy-paste error messages to get troubleshooting advice from the tool. Demonstrators were present to support the students, but they were briefed to avoid giving direct answers or code, instead focusing on coaching students through problem-solving strategies—such as how to refine their ChatGPT prompts and better understand the output.

ChatGPT itself is very intuitive to use, its conversational format made it easy for students to engage with, and the real-time feedback allowed for an interactive learning experience. There is a learning curve in terms of crafting effective prompts, but the tool became an effective means for them to independently explore coding solutions.

How did the tool/resource impact your teaching?  

The use of ChatGPT had a positive impact on my teaching, particularly in how I approach problem-solving support in coding. My teaching approach has always been centred around helping students learn how to solve problems, rather than simply giving them the answers. However, students often prefer a more direct answer, and it can be challenging to strike the right balance between guiding them and fostering their independence, without them getting frustrated. ChatGPT provided a middle ground—it allowed students to seek assistance without relying entirely on demonstrators or myself, stepping them toward solving problems on their own. 

How well did the tool/resource perform, would you recommend it?  

ChatGPT provided students with an additional layer of support that supplemented the teaching they received in the classroom. A key benefit is that they can access this support at any time outside of the classroom too, with instant responses. I would recommend this as a tool to support students with their coding – particularly natural science students who are using relatively simple code that ChatGPT can perform very well with.

How well was the tool/resource received by students? 

Generally students were really impressed with how helpful ChatGPT could be. Previously in this session I would have only been directing students to ‘Google’, to get them to find some code online that they can adapt to meet their needs. I would say that generally students found this quite difficult, and needed a fair bit of support to do this. With ChatGPT, the responses can be tailored to their dataset and code, which makes it easier to implement. Students within this session may not have had much experience Googling error messages to know just how much easier using ChatGPT was, but from a lecturer and demonstrator perspective, it was clear how much less frustration it caused them!

Some students were reluctant to use generative AI tools in general, expressing some ethical concerns. These students were in a minority, but it will be interesting to see how the debate about generative AI progresses in this respect.

Share a ‘Top Tip’ for a colleague new to the tool/resource 

If I had to give a top tip for using ChatGPT when teaching coding, it would be to teach students how to ask effective questions and refine their prompts, to get answers tailored specifically to their data and code. Encourage them to approach ChatGPT as a conversation rather than a one-time query; remind them that their initial prompt might not yield the perfect answer, and that's okay—it’s part of the problem-solving process to iterate and explore different ways of framing the question.

 

Contact for more information:

Dr Jenny Shepperson j.shepperson@bangor.ac.uk