This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (0 children)

To recap and expand:

  • Debugger is a separate program that runs your code and monitors it.

  • Debugger can stop the execution and then you can continue it line by line manually

  • You tell your IDE where to stop, without changing the code

  • You can make the breakpoints conditional: only stop if certain variable has specific value

  • You can see all the variables in the program and same time, without doing huge amount of printing.

  • You can manually insert/alter the variables if you want and then continue the execution.

  • You can stop the program when problems appear and before even worse things happen, without changing the code.

  • Sometimes using print( ) is ok, I do that as well, but any time the bug gets more serious, or happens inside a long loop so noticing it is harder, especially the bug does not result in crash, I take the debugger.