My tips on debugging #

Updated: 2025-06-07

This is a running collection of my thoughts on debugging. I’ll update these over time.

Improve errors, minimize print statements #

One common type of debugging is “print” style - just print the data you need at the time. Often this occurs because you don’t have enough information in the error itself:

raise ValueError("conflicting args")

Rather than add a print statement temporarily, just make the error better - it helps the next person when they come along:

raise ValueError(f"conflict args. Args found: {args})