|
|
|
|
|
by vram22
4590 days ago
|
|
>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. Yes. >Stepping through a program's execution line-by-line and checking your assumptions can be a lot slower in some cases. Yes again, particularly when the code is in a loop. Whereas, if you use print-debugging, even though the output will be repeated as many times as the loop runs, you at least have the possibility of grepping to filter it down to relevant (e.g. erroneous/unexpected) output. Here's a simple Python debugging function that may be useful: http://jugad2.blogspot.in/2013/10/a-simple-python-debugging-... |
|