University to job-ready

Stage 1 · Lesson 4 of 5

Debugging without copying answers

Foundations sprint

is a method, not luck. First, read the whole error message and the line it points to. Next, make the bug happen again with the smallest input you can.

Then guess what is wrong and test that guess. A print statement works, but a debugger is better: you set a breakpoint, the program pauses there, and you step through it line by line while watching the variables. Change one thing at a time.

If the program crashed with an , the stack trace lists the calls that led to it. When you are stuck, explain the code out loud, line by line; this finds a surprising number of bugs. Use AI to explain what an error means, then fix it yourself.

Common trappasting the error into a search engine or an AI and copying the first fix: the program works, you learn nothing, and the same bug returns next week.

A question to check yourself, an AI practice session and 2 cheat sheet entries come with the full roadmap. Unlock

Resources for this stage

Start with· follow one of these

Practise

  • Small exercises in Python, Java, C++ and more, with free feedback from a human mentor

Keep handy

  • Quick syntax lookups and a try-it editor: a reference beside your course, not the course

  • Beginner tutorials and online compilers for Python, Java and C++ when you are away from your laptop

Mark this stage as not done?