Learning to code in an immersive environment challenges learners to do work that they may not feel ready to do, using technology that they don’t really yet understand. Training in software engineering means thinking creatively, experimenting to find out how things work, and using mistakes and failures as fuel to propel you toward a solution.
We want our learners to be resourceful and persistent problem-solvers. Generative AI has become one of the resources our learners have at their disposal, and we know that they will encounter AI in some form in their jobs. So we’ve been thinking about how these tools fit into the toolbox of a beginner coder. Over the past several months, we’ve developed some guidelines about how coding beginners can use AI tools to support their learning. We’re confident that AI-assistance can, and should, be used to support the process of learning to code, with some instructor guidance.
Ask learners to explain their code
With project-based learning, skills are built during the process of figuring out how to do something. The time and effort spent doing a well-defined project becomes a valuable experience that forms a learner’s understanding. Each time a coding beginner does a project, it reveals to them a little bit more about how code works and the repeated effort to get code working evolves into understanding.
Submitting a project written by ChatGPT falls under the same Code of Conduct violation in our program as using code you didn’t write from any other source. You shouldn’t do it.
It’s easy to test whether someone wrote code themselves. Ask your learner to explain their code. If they can’t explain it, then the learning objectives have obviously not been met and there’s more work to do (and a conversation about goals and integrity to be had as well). At Momentum, instructors ask learners to explain their code constantly. We have opportunities to do this in real time during instruction sessions and when we’re working with learners one-on-one. We may also ask learners to record a video or present to a group, walking through how something they built works.
With this requirement to be accountable for your code, we’re not concerned about the potential for cheating with AI.
Turn off GitHub Copilot and other AI-assisted code tools in the editor
Code-completion tools, in our experience, tend to confuse and misdirect more than they help when people are still in the beginning stages of learning to code. The muscle-memory and brain-training that comes from the slow, manual process of typing code out yourself is a step that just can’t be skipped.
It’s helpful to see examples of working code for the task you’re trying to do. Every programmer learns by seeing code examples, reading and running them, learning new techniques, and getting inspired by the approach others have taken. But then you really have to type it out yourself, adapt it, and make it your own.
Experienced programmers can adapt suggestions made by AI tools like GitHub Copilot because they have the knowledge and insight to discern what to keep and what to discard in those suggestions. Beginners can’t discern this yet, and they need the space and time to develop those skills without preemptive suggestions getting in the way.
AI strategies that we’ve seen work
AI code-generation isn’t helpful for beginners and is currently perhaps only marginally helpful for experienced devs. But these tools have much more promise than code-generation; we’ve seen our learners using them in ways that we had to admit were pretty good. AI-assistance can provide useful boosts to help folks get past the overwhelm and anxiety that can inhibit progress and sap motivation. Here are some specific ways we’ve encouraged our learners to use AI tools.
Use AI to make tasks more manageable
We expect aspiring software engineers to learn to take a complex coding project assignment and thoroughly understand what they are being asked to do. Once they understand what they need to build, then they need to break it down into manageable tasks. AI can make this process much less daunting by helping folks envision and fill in the blanks of their own step-by-step process.
AI can explain confusing code and concepts
We’ve seen learners use AI effectively by asking questions about code they are trying to understand. The prompt to “explain this code” can help a learner make sense of an example from an instructor or something they found on Stack Overflow.
This works especially well with documentation that is sparse or directed at more experienced developers who can pick up on what’s implicit in a README. New developers need more information, and if you can’t reach an instructor at midnight while you’re puzzling over an example of how to use this Python package, AI is a great place to turn.
It’s also helpful for explanations in plain language, or “explain it to me like I’m 5,” for concepts that take people new to programming some time to get used to. Serialization, for example, is hard for beginners to grasp at first, and AI can supplement explanations from instructors or documentation that is confusing or just bears repeating.
Prompting AI forces you to form the right question
We teach the skill of asking effective, precise questions, which is an essential skill for any junior developer. We coach learners to identify what they are trying to do and what precisely isn’t working. Putting words to code concepts and seeing a problem clearly enough to describe take effort and practice. Every software engineer knows once you frame the question the right way you are most of the way to solving the problem. Sometimes all we need is the process of verbalizing the problem to help us recognize what we need to do, as our friends the rubber ducks know but will never tell.
The process of asking a question in a chat-style AI, and iterating over the question until you get a helpful answer, can help learners take a major step forward in their understanding of how to phrase what they need to know and what to do next. As an instructor, you can help learners refine their question-asking skills, which will pay off in many more contexts than a chatbot session.
Your learners are already using AI and need your guidance
Learners across all disciplines and levels are already using AI. Coding beginners will definitely use them. With your guidance, they can learn to use them in smart, effective ways that will get them closer to their career goals.
A software engineering career involves encountering problems that you may not know how to solve, but are confident that you can figure out. Laying the foundation for our learners to be adaptive, creative, and persistent problem-solvers means teaching them to use their tools and resources effectively. Now that those tools include AI-assistance, we can take advantage of the possibilities while still being smart about the liabilities.
AI is another technological turning point in human history, and like all the others, it comes with a lot to consider in terms of pros and cons. The folks we train today will be helping to navigate the world’s AI-powered future, and we owe it to them to prepare them to use AI tools, as best as we can at this early stage. At Momentum, we’re focusing on what’s good about AI, envisioning a future in which we use this technology in responsible, creative, and productive ways that raise the standards for everyone.