Debugging Python Like a Boss
Debuggers are cool and often necessary, but I disagree with this often-expressed sentiment that print-debugging is a primitive hack for people who don't know any better.<p>Debugging is determining the point at which the program's <i>expected</i> behavior diverges from its <i>actual</i> behavior.  You often don't know where where/when this is happening.  Print-debugging can give you a transcript of the program's execution, which you can look at to hone in on the moment where things go wrong.  Stepping through a program's execution line-by-line and checking your assumptions can be a lot slower in some cases.  And most debuggers can't go backwards, so if you miss the critical moment you have to start all over again.<p>These are two tools in the toolbox; using print debugging does not mean you are not "a boss."