Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re (tilly): (tye)Re2: Are debuggers good?

by tilly (Archbishop)
on Dec 29, 2000 at 06:41 UTC ( #48751=note: print w/replies, xml ) Need Help??

in reply to (tye)Re2: Are debuggers good?
in thread How to debug unknown dynamic code?

Please step back before ranting.

I have bugs. Of course I have bugs. When I post stuff off the cuff here I have a lot of bugs. Particularly when I post stuff that I didn't run, let alone test like I do before checking stuff into CVS.

I don't know anyone who doesn't have bugs.

Now please read what you responded to. Again. Without jumping down my throat first off.

When I say that debuggers allow us to blindly trace through code to find the symptoms of problems, I am not saying that that is the only way to use them. I am creating a caricature of the tendancy I don't like. When you use a debugger to find a problem in your code, you do indeed find the answer to that specific problem faster. But you lose an opportunity to review your logic and clean your code up, which can often solve more bugs and helps in comprehension. With the convenience and immediacy of a debugger, the details of what is happening are too handy and the thinking about why someone might not want it to be that way are too distant for my taste.

In short, I don't mind having to work harder for most bugs if it means that I get to program in a way where I wind up with fewer bugs in the end. Particularly since I have a lot of error checks which mean that if something does go wrong, I usualy have all of the information that I want immediately available. And if I don't, well that usually means that something more serious was wrong.

Besides which the ease of using a debugger can mask important warning signs. Warning signs that I would like to see.

Now as for Linus, while I see what he says, I likewise disagree with his position but for rather different reasons. Linus has been (IMO rightly) accused of suffering from The Curse of the Gifted. I think that applies here, he is underestimating the value of a tool for people who are not in his situation. In particular read again IBM's experience and look at all of the things that debuggers are listed as good for there. Yes, I think that a kernel debugger would be good. It would help people learn how the kernel works.

Note that all of my statements about not wanting to fix problems interactively don't mean that I don't think it isn't a great idea to learn from running stuff interactively. Just because Linus doesn't need to learn how the Linux kernel works doesn't mean that others wouldn't benefit from that! And it can be useful to step from time to time through fresh code...

  • Comment on Re (tilly): (tye)Re2: Are debuggers good?

Replies are listed 'Best First'.
(tye)Re3: Are debuggers good?
by tye (Sage) on Dec 29, 2000 at 06:46 UTC

    Yeah, I got the impression you were suffering from the "Curse of the Gifted" as well.

    At least it was labeled a rant. :-}

            - tye (but my friends call me "Tye")
      Now why would you get a silly impression like that?

      Rueful grin

      The discussion that is from started here.

Re: Re (tilly): (tye)Re2: Are debuggers good?
by runrig (Abbot) on Jan 11, 2002 at 22:42 UTC
    When you use a debugger to find a problem in your code, you do indeed find the answer to that specific problem faster. But you lose an opportunity to review your logic and clean your code up, which can often solve more bugs and helps in comprehension.

    I think I agree with you, but when I use debuggers, it's usually not on my code. In fact, I rarely use the perl debugger, because when I debug perl, its usually my own code :) I've on rare occasions used the perl debugger to help track down problems in library modules, but usually looking at the source is good enough because I find perl source easy to find, and (mostly) easy to follow.

    I've mostly used debuggers with monolithic 4gl code which would include libraries on top of libraries, and the only way to find a problem without inserting a zillion print statements was to run the debugger (and I don't want to fully comprehend all the code, at least not today, I just want to fix the problem). And I would inherit problems from other programmers who would work for days on a problem but couldn't use the debugger, and I'd solve it in a few minutes or hours. So IMO it just depends on the environment. I use the perl debugger so rarely that every time I have a notion to use it, I find I have to relearn it :-)

    Update: Oh, and one more reason I use the debugger less in perl is that you don't have to go through that 'compile it again' phase of the debugging process that you have to endure in other languages.

    Very late update: Recently, I found myself tracking down a problem with totally unfamiliar CPAN http/socket library code. I inserted a couple of $DB::single; statements rather than numerous print's (these were dynamically loaded modules, so this was the easiest way to set breakpoints) and learned something about HTTP...specifically about chunking in the responses.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://48751]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (2)
As of 2017-08-21 05:07 GMT
Find Nodes?
    Voting Booth?
    Who is your favorite scientist and why?

    Results (317 votes). Check out past polls.