AI as a Learning Companion

AI tools like ChatGPT, Claude, and GitHub Copilot can be incredibly helpful when learning to program, but only if you use them the right way. You should think of AI as a more knowledgeable experienced learning companion who can explain new concepts to you and help you to understand things more deeply.

You should use it to:

  • Understand concepts and syntax
  • Clarify confusing instructions and get hints for solving a problem
  • Debug your code with explanations of error messages
  • Review your code and get suggestions for improvement

But always do the actual coding yourself. The goal is to become a programmer and understand the code. If you ask AI to do your homework for you, not only is it likely that you will not learn, you may get the wrong answer. And you will never be able to even assess whether the AI has correctly solved a problem.

Giving the right prompt to complete a programming task successfully often requires a genuine understanding of the problem and a clear strategy for how to solve it, something that AI struggles with.


Great Ways to Use AI While Learning

1. Ask for Explanations of Concepts

When you encounter a new concept or an explanation that you find confusing or difficult to understand, ask AI to explain it in simple terms:

Good prompts:

  • “What’s the difference between a list and a tuple?”
  • “When is a list more appropriate than a tuple?”
  • “Can you explain what a dictionary is in Python and when I should use one?”
  • “Can you explain how a for-loop works and walk me through step by step how one works”

2. Clarify Exercise Instructions

If you’re not sure what an exercise is asking you to do, ask AI to rephrase it for you:

Good prompts:

  • “I’m working on an exercise about functions. It says ‘write a function that takes two parameters and returns their sum.’ What does this mean exactly?”
  • “The exercise asks me to ‘validate user input.’ What does validation mean in programming?”

3. Understand Error Messages

When your code doesn’t work, paste the error message and ask for help:

Good prompts:

  • “I got this error: ‘TypeError: unsupported operand type(s) for +: ‘int’ and ‘str’’. What does this mean and how can I fix it?”
  • “My code says ‘NameError: name ‘greeting’ is not defined’. What’s wrong?”

4. Get Hints, Not Solutions

When you’re stuck, ask for guidance on approach rather than the complete answer:

Good prompts:

  • “I need to count how many times a user gets a question right. What type of variable should I use to keep track of this?”
  • “I want to let users practice random flashcards. Is there some way of getting random selection with Python?”

5. Code Review and Improvement

After you’ve written code that works, ask AI to review it:

Good prompts:

  • “Here’s my working code [paste code]. How could I make it cleaner or more readable?”
  • “Does this code follow good Python practices? Any suggestions for improvement?”

Ways of using AI that will hurt your learning

Asking AI to Complete Exercises

Avoid prompts like:

  • “Write a function that calculates the area of a rectangle”
  • “Create a flashcard app with a menu system”
  • “Solve this exercise for me”

Why this hurts:

  • You miss the struggle and problem-solving that builds real understanding.
  • If the problem is a complex one, AI can start to make mistakes but “lie” about what the code does by writing misleading comments.

Copy-Pasting Large Blocks of AI Code

Why this hurts:

  • You won’t understand how the code works, and you’ll be lost when you need to modify or debug it.
  • Again, when the problem is a large complex one, AI often starts to make mistakes but misleads you into thinking they have solved the problem in the comments.

AI Tools and Features

ChatGPT/Claude for Questions

  • Excellent for explanations and concept clarification
  • Tip: Ask follow-up questions if you don’t understand something
  • Tip: Ask for examples to illustrate concepts

GitHub Copilot in VS Code

  • Great for code completion and suggestions
  • Tip: Try not to use this until you have finished the Core Skills part of the course
  • Tip: Read and understand the suggestions before accepting them
  • Tip: Use it to learn new syntax patterns, not to write entire functions

The Programming Learner Mindset

Goal: Use AI to understand better, not to avoid learning.

Remember:

  • Making mistakes and fixing them is how you learn, especially in programming.
  • A big part of achieve deeper understanding in coding is observing when errors occur and unpicking why.
  • Understanding why something works is more important than getting it to work. Something working when it shouldn’t is just as concerning as it not working when it should!


← Back to where you were | → Start the course from the beginning