Debuggers (was Re: [LCP]Printing a Variables Value..!!!)

Greg Black gjb at gbch.net
Tue Jun 24 14:52:02 UTC 2003


On 2003-06-23, David Lloyd wrote:
> > In general, C programmers (with the exception of those who have
> > chosen not to adopt sensible programming practices) don't use
> > debuggers.  I don't even know how to drive any of the debuggers
> > available to me, and do not look kindly upon my programmers if I
> > catch them wasting time with such tools.
> 
> Some people, conversely, who know how to use debuggers can use them to
> great effect. I think (from listening to many more experienced
> programmers) that there are many programmers who rely too much on
> debuggers but it doesn't mean that the debuggers are a bad tool.

I didn't mean that I don't know how to use debuggers in general,
just that it's so long since I've needed to use one that I don't
happen to have needed to learn the specifics of the ones that
are available for the platforms I use these days.

However, I have a lot of experience over the years of watching
people wasting time with debuggers when a bit of serious applied
thinking would have solved their problems far more effectively.
In general, a debugger should be the very last tool that you
reach for and then only after having put some real work into
looking for the problem with generally more useful tools.

Of course, there are occasions when you manage to write a bug
that is difficult to detect by other means -- but it's better to
learn to write code that does not fall into that category.

Greg



More information about the linuxCprogramming mailing list