The Problem

Everyone just throws print statements everywhere. There's a better way.

Use a Debugger

Learn your IDE's debugger. Set breakpoints. Inspect variables. Step through code.

Binary Search the Bug

Comment out half the code. Still broken? Bug is in the other half. Repeat.

Rubber Duck Debugging

Explain the problem out loud. You'll often solve it yourself.

Git Bisect

When did it break? Use git bisect to find the exact commit.

The Reality

Sometimes you still just add print statements. But at least try the proper tools first.


Sign in or sign up to add comments on this article.

The binary search debugging method is a game changer.

These are basic techniques every competent engineer should know.