(tye)Re2: Are debuggers good?
by tye (Sage) on Dec 28, 2000 at 23:13 UTC
|
I don't know you, tilly, nor merlyn. Most of the programmers I know that won't use a debugger for debugging don't know how.
My point was that if you want to debug by adding trace output, then you can do that very well with a debugger (and I think you can "add trace" much more efficiently with a debugger -- though adding the trace during development and being able to enable it in production is an even better idea that still doesn't eliminate the usefulness of a good debugger). So I don't understand the argument that you don't use a debugger for debugging because instead you do it by adding trace.
<rant>
And I do disagree with the undertext that using debuggers means that a programmer isn't being careful up front or that it leads to programmers who aren't careful up front. I find more bugs in other people's code than in mine, even when debugging my own code. I spend a great deal of time figuring out how to work around other people's bugs because I don't have the option of fixing them even though I've found them.
I do wish that other programmers would be more careful (as I talked about previously in (tye)Re: Why, not How). I don't think (as Linus seems to) that taking away debuggers will have any positive effect at all. That would just mean that when bugs crop up (which never happens to tilly nor merlyn because they are careful, despite having seen several of their bugs myself), more time will be spent tracking down that bug so there will be less time for improving other aspects of the software.
I really doubt that it will be possible to remove many bad programmers from the profession (no matter how hard we manage to make programming). A bad programmer with a debugger still wastes plenty of time and has lots of motivation to be more careful. In fact, I've seen use of a debugger help a bad programmer learn how to be a better programmer.
Never attribute to laziness what can be explained by ignorance. I think that most bad behavior that is blamed on laziness (or not being careful) has more to do with ignorance.
[Debuggers] let us blindly trace through code to find the symptoms of problems.
See, you think you know how to use a debugger but that statement tells me that you really don't. I never debug with a debugger by blindly tracing through code. My word, that would be a huge time sink.
</rant>
-
tye
(but my friends call me "Tye")
| [reply] [Watch: Dir/Any] [d/l] [select] |
|
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...
| [reply] [Watch: Dir/Any] |
|
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")
| [reply] [Watch: Dir/Any] |
|
|
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.
| [reply] [Watch: Dir/Any] [d/l] |
Re: Re (tilly) 2: Are debuggers good?
by merlyn (Sage) on Dec 28, 2000 at 20:43 UTC
|
I particularly like Linus' statement in that post:
Quite frankly, I'd rather weed out the people who don't start being
careful early rather than late. That sounds callous, and by God, it _is_
callous. But it's not the kind of "if you can't stand the heat, get out
the the kitchen" kind of remark that some people take it for. No, it's
something much more deeper: I'd rather not work with people who aren't
careful. It's darwinism in software development.
It's a cold, callous argument that says that there are two kinds of
people, and I'd rather not work with the second kind. Live with it.
I fully support that. There are far too many people who (attempt to) perform programming as a income activity who aren't really programmers. If you can't program careful enough to not need a debugger, then either slow down your rate of coding, or pick a different profession. Please.
Thanks for the reference, tilly. That's the point I was trying to make earlier. I don't use a debugger, because I try very hard not to need one. {grin}
-- Randal L. Schwartz, Perl hacker | [reply] [Watch: Dir/Any] |
|
There are far too many people who (attempt to) perform programming as a income activity who aren't really programmers. If you can't program careful enough to not need a debugger, then either slow down your rate of coding, or pick a different profession. Please.
This is, of course, true. There aren't enough real programmers around to cover all the programming jobs. And as the demand for IT staff increases the problem will only get worse.
I was contemplating starting to run Perl courses in the
UK, but perhaps I should just run programming courses
first...
... or perhaps "programming" isn't something that can
be taught.
--
<http://www.dave.org.uk>
"Perl makes the fun jobs fun
and the boring jobs bearable" - me
| [reply] [Watch: Dir/Any] |
|
Had to throw my .02 out when I read:
perhaps "programming" isn't something that can be taught.
IMHO its the term programming that keeps people from learning it.
Programming is merely a stereotyped word that detracts the average person from more actively interfacing with thier computer; Therefore, programming is not a skill to be learned, but rather must be a personal goal to be attained.
coreolyn
| [reply] [Watch: Dir/Any] |
|
|
|
Re: Re (tilly) 2: Are debuggers good?
by footpad (Abbot) on Dec 29, 2000 at 00:41 UTC
|
tilly,
I'm not sure I read that the same way you may have. I thought tye was sharing some of the tricks learned while working with the language. While it's possible to interpret some moral judgements (to borrow a phrase elsewhere in the thread) from the post, I don't see anything specifically suggesting that you or merlyn are taking positions from ignorance.
Perhaps that's my own judgement peering through.
Regardless, it may be worthwhile to borrow a another concept from the monastic disciplines that inspired this site. Specifically, each travels their own path toward mastery.
I don't use debuggers personally for many of the reasons cited in both camps. However, I do use them when necessary. They can be effective tools, but they should not be the only tool in your problem solving arsenal.
In the end, we make choices by bringing our experience, knowledge, and creativity to bear on the problem at hand. Even bad choices can help illuminate the path.
--f
| [reply] [Watch: Dir/Any] |
|
We definitely did read it differently. I was explicitly
saying that I don't use the debugger for debugging, and in
response to that tye answered saying that he thought that
people don't use it because of not wanting to take time to
learn to use the debugger. He went on to tell me to use
one the next time I need to debug. Despite the fact that I
am saying that my not using one is intentional.
I read that as his not paying attention to what I said (the
fact that I am making an intentional choice) and assuming
that if I am exposed to the joys of debuggers then I (being
a presumably sane human being) will convert.
That is what I reacted to, and I don't think that I reacted
particularly unreasonably to it.
| [reply] [Watch: Dir/Any] |
|
| [reply] [Watch: Dir/Any] |