ChatGPT in the classroom. Exploring its potential and limitations in a Functional Programming course
Dan-Matei Popovici
TL;DR
This study empirically evaluates ChatGPT in a Functional Programming (Scala) course, using a corpus of 72 tasks to measure correctness, readability, and educational value. It finds that the first ChatGPT response is correct in about 68% of cases, improving to 86% with follow-up prompts, yet only roughly half of those correct solutions are legible or instructional. ChatGPT demonstrates strong capabilities in automated code reviews, enabling a semi-automated feedback loop, though its usefulness as a sole learning tool is limited, particularly for harder tasks. The authors discuss mitigation strategies, compare ChatGPT with GitHub Copilot, and propose future directions, including integrating Copilot into FP curricula and developing automated, publicly accessible code-review tools to support educators. Overall, the work provides data-driven insights into how AI can augment programming education while highlighting the need for human oversight and pedagogical adaptation.
Abstract
In November 2022, OpenAI has introduced ChatGPT, a chatbot based on supervised and reinforcement learning. Not only can it answer questions emulating human-like responses, but it can also generate code from scratch or complete coding templates provided by the user. ChatGPT can generate unique responses which render any traditional anti-plagiarism tool useless. Its release has ignited a heated debate about its usage in academia, especially by students. We have found, to our surprise, that our students at POLITEHNICA University of Bucharest (UPB) have been using generative AI tools (ChatGPT and its predecessors) for solving homework, for at least 6 months. We therefore set out to explore the capabilities of ChatGPT and assess its value for educational purposes. We solved all our coding assignments for the semester from our UPB Functional Programming course. We discovered that, although ChatGPT provides correct answers in 68% of the cases, only around half of those are legible solutions which can benefit students in some form. On the other hand, ChatGPT has a very good ability to perform code review on student programming homework. Based on these findings, we discuss the pros and cons of ChatGPT in education.
