Just another Perl shrine | |
PerlMonks |
Re^2: In Defense of Smart::Commentsby SuicideJunkie (Vicar) |
on May 31, 2010 at 14:46 UTC ( [id://842423]=note: print w/replies, xml ) | Need Help?? |
An interactive debug is quite handy. I did manage to use the built in debugger at one point, but I've forgotten how by now due to disuse. Since my project is interactive itself, I've built debugging options right in. (Only for the user logged in as root, however)
Aside from the prerequisite of interactivity, my app also has a giant hash tree containing all of the important state info. It is used to save and restore to/from disk between runs, but it also provides straightforward access to almost everything for debugging. As far as leaving the debug in goes, a bunch of print Blah if DEBUG; aren't going to hurt. Knocking exponents off the Big-O and filtering down the value of N is where the real speed is found. For non-interactive apps using print-foo-if-debug-constant is what I used to do. The benefit of category-based debugging, with the compile time removal of that code when the constants are set to false.
In Section
Meditations
|
|