[nem-en] Re: The ReportFatal problem
vc
vc at rsdn.ru
Wed Feb 14 02:14:58 CET 2007
> Using Exceptions for control flow is a bad design in most cases,
Using Exceptions for control flow is a bad design in any cases.
A programmers simply does not see problem in concrete palace and concrete
time (it's full analogy with goto).
> but I
> see it completely valid if you have a few tousand lines of complex
> logic and few places which should break the current processing up to
> some point independently.
Goto also can be used instead code redesigned, but you not include this
statement in the language. And I understand your decision. Not structured
workflow a king of bad design.
> The usage of
>
> def (value, code) = foo ();
> if (code == SUCCESS)
> ...
> else
> ...
>
> vs
>
> try {
> def value = foo ();
> ...
> } catch {
> | e is MyException => ...
> }
>
> is almost the same, but with first case you need to add handling of
> "code" at every f... level of call graph.
It's error handling. It's OK.
But all cases where your use exceptions for workflow we (I and IT) have some
problems. One case I eliminate (EOF handling) because it was problem in
debug mode.
PS
I wish return to a problem.
ReportFatal (and exception throw from it) cause many problems in VS
integration. And I not see how eliminate it. For example syntax error in
foreach prevent all typeinfo for following code.
More information about the devel-en
mailing list