Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Thinking about it, i suppose that is a proper way to explain what is happening for a lot of programmers when they debug. Don't know if i qualify as a programmer but i usually try something like the following:

1) make every block of code simple and direct
A block of code can be a subroutine, a script, or sometimes just one line. Just make sure that that block does exactly what it says and no more (this usually requires double checking while writing the code)

2) when debugging, find the blocks of code that relate to the problem
Since we know that blocks of code only do their one thing (hopefully well), we can narrow it down to certain parts relatively quickly

3) Pat yourself on the back for the blocks of code that didn't cause a problem.
This is an ego boost for a job well done, at least on part of the code.

4) Triple check that your solution worked
This will assure that you will have less problems next time something goes wrong

5) Look for the next bug
It's probably in that block that didn't have an error last time, but now you can pat yourself on the back for a different piece of code.

Me thinks my main problem is that i will always assume there are unsolved bugs in my code, even when it's fully working, even if it's only one line. So patting myself on the back is a way to get myself to continue since i'll know that at least one piece of code is ok.

to each their own, TIMTOWTDI
jynx


In reply to Re: Tricking Our Egos by jynx
in thread Tricking Our Egos 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 contemplating the Monastery: (3)
As of 2024-04-19 20:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found