SHORT Re: Suggestion: "fix" assert(obj)
Jascha Wetzel
firstname at mainia.de
Thu Jun 21 10:32:10 PDT 2007
Martin Howe wrote:
> To the novice, a debugger is indeed a scary place of last resort; however,
> to the professional the debugger can also be a place of excessive effort
> that can often be shown to be unnecessary; thus a debugger is stll a last
> resort, but with "scary" replaced with "over complicated"; you get the idea
> :)
to a novice, many things might be scary, including D itself, so i won't
argue here.
to an experienced programmer a debugger should be a tool that saves you
from applying multiple add-printf/recompile/restart cycles by letting
you intercept the program when it crashes and inspect the stack and heap
instantly. it is there to complement asserts and exceptions, not as an
alternative to them.
that surgery analogy doesn't quite work here, since printf's are even
more invasive: you're basically implanting a piece of a debugger into
the organism.
> It's annoying to have to assert() that the object exists first, but better
> than having to tell your client's overnight low-tech personnel in country
> 3,000 miles away how to compile a suite whose source code they do not have,
> with a compiler they do not own and then run with the debugger that they do
> not understand on data whose trigger conditions no longer exist, all over
> the phone at 3am your time.
and that's what memory dumps and post-mortem debugging is for.
the client sends you the dump and you can debug the exact instance of
the crash.
More information about the Digitalmars-d
mailing list