Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

RE: Debugging

by BigJoe (Curate)
on May 24, 2000 at 03:20 UTC ( #14474=note: print w/replies, xml ) Need Help??

in reply to Debugging

You can feel it, you have felt it all your life. What you feel you can not explain but you know it is there.

Have you ever had a dream that seemed so real? What if you never woke from that dream? Could you tell the difference between the dream world and the real world? --Morpheus

Replies are listed 'Best First'.
RE: RE: Debugging
by BBQ (Deacon) on May 24, 2000 at 10:10 UTC
    There is no spoon.

    Seriously though, I beleive that the flash that you where refering to is when you realize that you did it wrong in the 1st place. I rarely use perl's debugger. At most, I run -c just to see if I don't have a typo somewhere, but TRUE debugging, very rare. Mind you, that, I'm not a programing super-hero or anything of the sort. Its just my way of doing things.

    When scoping through code, instead of trying to find the logic in what was just written, I find it more productive to review the logic itself and what it was I was trying to accomplish in the 1st place (ie: read it as if I were reading perlmonks). This is a habbit I aquired when reviewing trainees' coding. I always ask myself, "How would I do it?" even if the code is mine. I just pretend it isn't.

    Invariably, I'll hit the bad spot (if it isn't just a typo) during the 1st run through. Else, I give it to someone else to read and come back to it later. It also helps to explain out loud why each line is written the way it is.

    Just my R$0.02 (Brazilian two cents) worth.
      I used to debug a lot like you do, it works fine. Another good trick is to abuse Data::Dumper for debugging when diving into data structures and objects. But these all can be trememdously slower sometimes, especially if the original code is not yours. I did not really start using debuggers until I got to my current job where some of the programs are 30k lines long, none of which were written by me. They are not a bad sized programs, but some were written in the most bizzare way, and no strict. Yet I still have to fix the bugs that are reported.

      It is hard to get into debuggers at first, but investigate some of the gui ones like Devel::ptkdb or DDD. Getting really familiar with a good debugger is (in my opinion) one of the most advantageous things any programmer can do.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://14474]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2021-11-29 21:27 GMT
Find Nodes?
    Voting Booth?

    No recent polls found