http://qs321.pair.com?node_id=14508


in reply to RE: Debugging
in thread Debugging

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.