Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
As I've never really worked very closely with debuggers, I've always worked on arriving at sane design and used print statements. It's been my experience that 99% of all problems that arise can be solved by one of these three methods:
1) print statements. Usually, you are assuming that a given variable has a certain value when it doesn't. (Yes, I know that examining memory within a debugger does this, but I feel that debuggers are usually overkill.)
2) Writing out the flow. You might be assuming that a function is called exactly n times, when it's really being called n+1 times. Or, that foo() is called before bar(). This contributes to sane design.
3) Adding anal checks. Are you doing @$foo? It might be useful to verify that ref($foo) eq 'ARRAY'. These sound stupid, but if you're writing something that a human will enter data for, you cannot be too careful. If a human can mess it up, a human will mess it up.

And, no, kids these days aren't less capable debuggers ... than we were when we were kids. I remember learning how to debug 8 years ago, when I was just getting into college. Just remember that a lot of the people with 2-4 years experience are only 19 or 20 years old. They're still kids.


In reply to Re: Are debugging skills atrophying? by satchboost
in thread Are debugging skills atrophying? by dws

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (8)
As of 2024-03-28 09:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found