----boundary-LibPST-iamunique-1976151787_-_-
Content-type: text/plain
On Mon, 12 Jun 2006, Rene Krywult wrote:
> Wojtek Skulski schrieb:
>
> >On Mon, 12 Jun 2006, Marco Ciot wrote:
> >
> >>The intention of the programmer when placing an ASSERT should never be to
> >>halt the program at that point but to assert some important condition for
> >>the subsequent program code.
> >
> >What do you mean by "assert some important condition"? What should a
> >program do when the assertion fails? Right now it halts. If this is not
> >what you want, then what action are you proposing instead?
> >
> >
> Sorry, but in no serious program for a non-technical customer a trap is
> a *wanted* result ;-).
Yes of course. However, Marco did not say this. He said something about
"assert some important condition" without saying what this should mean.
> If the error is the customer's fault, he needs a serious error message
> telling him what to do. And if it is not his fault, then the programmer
> has to make sure that the error doesn't occur. "Traps" may be fine if
> you do some programming for yourself, but if you sell software, you'd
> better not program "traps";-).
You are now saying how the trap should be handled. Right now it pops up
an unpleasant-looking debugger window which is good for a developer
but will scare a customer. This is not a language issue but rather an
implementation issue.
Two possible solutions:
1. Define various handlers for different trap ranges. E.g., traps
between 20 nd 60 will pop up green windows with a smile, the range
between 61 and 100 will popup a red window with a wiggling finger,
and trap 1000 will turn off power.
2. Use MyTools.MyASSERT (expression, number) to catch a range of
numbers for which you have implemented your own handlers,
pass-through to the regular ASSERT otherwise.
Of course there must be better ideas around.
W.
--- BlackBox
--- send subject HELP or UNSUBSCRIBE to blackbox{([at]})nowhere.xy
----boundary-LibPST-iamunique-1976151787_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnR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