Fair point, but this is one many of us are guilty of -- and I think that is ok. First of, the Perl debugger isn't the most friendly tool in the world. Secondly, coming from many environments when attaching a debugger is not going to help much (say, an unfamilar OS such as Netware, web interfaces, or debugging the C code being loaded by a java JNI process), it is not to say that debug-by-print-statement is sin. It is this second reason that I have grown not to rely on debuggers and IDE's. Usually, I can't depend on them. I depend on runtime error checking most of the time -- and debug-by-print when things get hairy (which is not often). Plus sometimes using a debugger means your brain isn't really rapped around the code. I've been around folks who say "I need a debugger" -- but I've really learned to read code for flaws (even without prints). Using 10 different platforms and 3 or 4 different languages at work makes you do that.
In many places, debuggers are heavy hammers to wield, and print statements serve their quick-and-dirty place. In more sophisticated ways, you can write less-dirty debugger modules that can route their output to log files and such MyDebug::debug(-level => 4, -msg => "AllYourBase"), which is something like what log4perl does, though I've never used it -- crafting my own simpler hooks was easy enough.
Didn't Larry himself say he didn't use the debugger much?
update: just reading random monks home nodes (I should be watching basketball -- go AirForce! Beat UNC!), I came across this interesting commentary on debuggers. It drives home a few of my points, or at least gives me the assurance that I am not alone.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.