Skip to content
BENIBIX Learn

Debugger

Development🛠️ Editors & ToolsCode Quality Tools

A tool that stops a program mid-run. You look inside and step through it.

Think of it like

Think of it like a video you can pause. You stop at any moment and look closely at what is going on.

Example

Emma pauses her app just before the total is worked out. She sees price is 0, not 10, and finds the bug on the line above.

Why it matters

Guessing what code does is slow. A debugger shows you what it really does, line by line.

Definition

A debugger is a tool that lets you run a program one step at a time. You can pause it at a chosen line and look at every variable's value. Then you step forward line by line and watch how the values change. This shows exactly where the program goes wrong. Most IDEs and code editors have one built in.

Example code

console
$ python3 app.py
> app.py(2)<module>()
-> breakpoint()
(Pdb) p price
10
The program stops, and p prints the value of price.

Common mistake

Only ever adding print lines. They work, but a debugger shows each value and leaves the code alone.

Key takeaways

  1. 1
    Pause anywhere. Stop the program at a chosen line.
  2. 2
    Look inside. See every variable's current value.
  3. 3
    Step through. Move one line at a time.

Learn it properly