Richard said:
Bah. We've been down this road before. A good debugger with read watch
points, write watch points, expression watch points etc. can ONLY make
it easier.
Yes, we've been here before, but I think it is worth having one last
stab at explaining one of the "other" points of view. I will try to
be very clear:
First, I use debuggers. There are times when they are just the right
tool. Please don't miss-represent the following as my never using
then or my never advocating their use.
However, I don't think "they can only make it easier". That very much
depends on how your mind works. It may be true for some people -- I
can't say -- but for me it often is not. Watching code execute or
values change in a debugger takes the compact expression of an
algorithm and unwinds it over time into a sequence of trivial events.
Now, for some people, it seems that they can take that and synthesise
an understanding of the code from these events. I find that very
hard. There is too much data and it is in the wrong form -- ordered
over time.
The net effect of most programs (or program fragments) is to bring
about some state of affairs (that the data be sorted, that variable x
contain the date of Easter 2012, whatever) and these are static
properties, not temporal ones. Extracting what a program is really
doing (or not doing right) from the sequence of its steps is, for me,
very much harder than analysing its text.
My computing experience dates from the days before debuggers
(certainly before source-code debuggers) so I remember the joy having
these sophisticated tools for the first time. But I also remember
wasting a lot of time with them before I learnt that watching code
execute often[1] impeded my understanding of it. Please, before you
question my honesty or claim I must be posturing, consider the
possibility that people are different and not everyone thinks the way
you do. When you posted a while back that running code under a
debugger was an essential technique for understanding it, I did not
dismiss it. I added it to the set of thing I know about how people
think about (and work with) programs.
Finally, there are also situations where debuggers are not available.
Curiously, we are moving into a new phase where they are, to all
intents and purposes, not available -- concurrent and threaded
programming. From what I have seen so far, current debuggers can not
help (much) in understanding the behaviour of buggy concurrent
programs, unless the bug are in the non-concurrent behaviour, of
course. I am sure this will be sorted out eventually, but for now,
reasoning about your concurrent programs is the state of the art.
[This if off topic, of course. I have set followup-to
comp.programming where I would be happy to continue this debate.
Please consider honouring the followup-to, quoting all or most of my
text. I won't reply if you want to keep the discussion here.]
[1] Not always. Remember: I do use debuggers. If you include tools
like mudflap and valgrind, I use debuggers all the time.