As you may have heard or seen, AI programming assistants like ChatGPT, GitHub Copilot, and Microsoft IntelliCode are good at generating straightforward and moderately simple pieces of code. And, as you may notice, in this class, we will often ask you to write relatively straightforward and simple pieces of code. Therefore, you might be tempted to use code-generation tools to solve such problems. Please avoid these tools unless I specifically ask or permit you to.
Why? Because evidence (or at least experience) suggests that you cannot solve more complex problems until you develop basic competency with the syntax and semantics of a programming language, its associated computational model, and the broader skills of computational and algorithmic thinking. If you use a tool to write the code instead, you won’t develop the skills you will need in the future, the skills that are key learning outcomes for the course.
Think about playing basketball (or any sport, I suppose). Do you always sink a basket when you shoot? Probably not. But the more you practice and play, the better you get. And fixed practice, such as repeatedly shooting from the same location, though basic, improves your skills. Playing is fun. Sometimes practicing is even fun, at least as you get better.
We hope that you’ll also find designing and writing programs fun. We also admit that it will also be challenging, time consuming, and even frustrating. But you’ll find over time that you feel a sense of accomplishment (and maybe even joy) when you solve problems on your own, rather than relying on one of these associated tools.
If you find yourself using a tool to make you more efficient on something you feel you’ve already mastered, make sure to cite or acknowledge the tool that you’ve used (just as you should cite any resources you use to refresh your knowledge). And please speak with me before doing so.
We also ask you to consider the potential ethical and legal issues of using one of these tools. Most (all?) of these tools have been trained on codebases without the permission of the authors of that code, often in violation of the licenses associated with that code. There is already one major class-action lawsuit about this issue. Hence, many major corporations do not allow their developers to use such tools. More importantly, it is generally wrong to use the work of others without their permission, and you would be doing so by using these tools.
You should also remember that most tools also gather information from their users. You consider whether you are comfortable sharing your private information. It’s been suggested that, at some point, some of these tools may market information about your use of the tool (e.g., to prospective employers). I recommend that you consider turning off data gathering, if possible, such as by selecting Settings -> Data Controls and then turning off Chat history and training in ChatGPT.
Returning to our initial considerations: Many of the problems we give you are problems that have been solved thousands (if not millions) of times. If all we cared about was that you know an answer, we’d just give you one (or more). The process of developing the answer is where you learn, and you are here to learn. That is to say, if you use these tools, you likely harm your learning more than you help yourself.
The mastery-grading approach that we use in the course is also intended to make it okay for you to try things and not succeed. If your first solution doesn’t work, you’ll have a chance to try again (and again and …).
Finally, College policies about Large Language Models and Academic Honesty also apply in this course. Please make sure to familiarize yourself with the College’s policies on honesty in academic work and the latest Academic Honesty Handbook.
I’m permitted to use these kinds of tools in other classes. Why can’t I use them in your class?
As you’ll find with many things, faculty have different perspectives. I don’t think you’ll learn as well if you rely on these tools.
What’s the difference between using these tools and the other code-assistance tools integrated into some IDEs?
That’s a great question. It’s mostly an issue of the level of help. Historically, we’ve used tools to help us remember the details of procedure calls (e.g., the name of a procedure and the types of its parameters), but the deeper design steps remained with the programmer. I’m concerned that the newer tools are taking design issues away from the programmer.
What about automatically generating setters and getters?
The first few times you write setters and getters, you should write them yourself. After that, feel free to use (and cite) the tool.
How should I cite/acknowledge the tool?
I’m okay with almost anything that indicates that you got help. For example, a quick “setters and getters generated by IntelliCode” in the program header suffices. If you feel like writing a full MLA-style citation, that’s fine too. An MLA-style citation might look something like the following.
“Write setters and getters for the fields foo, bar, and baz” prompt. ChatGPT, 20 July 2023 version, OpenAI, 21 July 2023. chat.openai.com/chat.
Why should I cite the tool?
It’s good practice to cite/acknowledge others. Professionals generally try to give credit where credit is due.
How will you know if we’ve used one of these AI-based tools?
In most cases, we won’t. As we suggested above, the primary reason that you shouldn’t use the tools is that you’ll learn less.
However, we may see some stylistic issues that suggest that you either used an AI tool or found the code elsewhere.
I prefer that we not treat this issue antagonistically. I try not to go out of my way to look for this kind of inappropriate behavior in my class. But if I notice it, I will deal with it appropriately.
Will you report me to the Committee on Academic Standing (CAS) or the CS Department if you suspect that I’ve used one of these tools?
If you cite/acknowledge the tool, I will not report you.
Are there good ways to use these tools for students at the introductory level?
Once you’ve “solved” a problem, you might ask a tool to generate a few alternate solutions. I’d recommend that you then compare the solutions yourself to think about why you might choose each one.
You may be tempted to ask a tool to identify potential problems in your code or to help you debug. I’d recommend that you do that late in the process. Finding your own errors is its own useful skill. Walking through your code with an instructor, class mentor, or evening tutor is a much better alternative. Unit tests should also help!