Re: Feature Request: Hide debugging code.
- From: Zathras <webnewsgroup@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 28 Nov 2007 21:46:10 GMT
On Tue, 27 Nov 2007 05:54:08 +0100, "Skybuck Flying"
<spam@xxxxxxxxxxx> wrote:
It could be handy if this code could be marked as "debug code" and then it
would be more handy if it could be "hidden".
I'd be worried about hiding in-line code as it would be too easy for
me to forget about it and miss something. So, if we ignore this
requirement (just for the sake of suggesting a completely different
strategy)...
This way once the programmer is done writing some debugging code it can be
hidden away.. so the programmer can focus on the real code.
...and look at what might happen in the field.
A customer has bought your application and calls to report a problem.
You think it's a bug but you need more information than "it crashes
all the time". What can you do because with certain issues (e.g.
hardware vs software DEP), you may be unable to reproduce locally.
Even VNCing in may not be that helpful.
You'd likely have to send them a special debug version with the debug
code enabled with the methods previously mentioned.
In common with many major applications, what I do is to have a user
selectable option to write log files. When this happens, all
user-readable status messages and error messages are also output to
the log file with line time stamps. By doing this, you can see what
the user did and when and what went wrong and where. I do wrap a lot
of my procedures in try..except constructs and raise exceptions rather
than produce message boxes to ensure fine grained error messages are
produced and program control maintained. I've found this discipline to
be massively useful as it self documents the code (via status texts)
and allows rapid debugging during development as well as some peace of
mind when deploying an application to the public.
Ok, I use logging on or off but there's no reason why you cannot use
more fine grained logging (e.g. file system logging, memory use
logging etc) if you wish.
If you think this is slow and cumbersome, it's not. Even if it was,
I'd just get a faster PC!
--
Z
.
- References:
- Feature Request: Hide debugging code.
- From: Skybuck Flying
- Feature Request: Hide debugging code.
- Prev by Date: Re: Feature Request: Case statement needs improved default syntax
- Next by Date: Question about Application.Handle
- Previous by thread: Re: Feature Request: Hide debugging code.
- Next by thread: change remote dbg port in delphi 7?
- Index(es):
Relevant Pages
|