POV-Ray : Newsgroups : povray.off-topic : Error mesage : Re: Error mesage Server Time
7 Sep 2024 13:26:13 EDT (-0400)
  Re: Error mesage  
From:  
Date: 1 May 2008 19:56:17
Message: <481a58a1$1@news.povray.org>
"Warp" <war### [at] tagpovrayorg> wrote in message
news:481a2348@news.povray.org...
> . wrote:
> > "Orchid XP v8" <voi### [at] devnull> wrote

> > > Unfortunately, it has become common for programs to give messages such
> > > as "an unexpected error has occurred. Sorry."
> > >
> > > [BTW, WTF is an *expected* error anyway??]

> > Actually, the above *is* an example of an expected error (the programmer
put
> > that message in, didn't he?). Unexpected errors either go unnoticed or
crash
> > the system.

>  Wrong. Unexpected errors are things which should never happen, and if
>  they do

Want to rephrase that? <g>

> the indicate a bug in the program.
>   Typical example:
>
> switch(something)
> {
>  case A: ...
>  case B: ...
>  ...
>
>  default:
>     error("Unexpected error happened.");
>     // This should never happen because all possible cases were dealt
above.
>     // If we ever get here, it's a clear sign of a bug in the program.
> }

No, the error is either expected, but programmer shows bad form (ie, the
programmer anticipates "illegal" input but doesn't check it at the procedure
entry, and instead does it inside program logic) or a pointless exercise, as
in:

If ((X=True)=True)=True Then ... //just making sure!...

or

If X=4 Then
   ...
Else if X<>4 Then
  ...
Else
  Exception()..

Sure, QM, if nothing else, tells us that there are no guarantees, but it's
pointless to expect an error where it cannot logically be, or raise
exceptions in places that cannot logically be reached. Conversely, under
abnormal circumstances, all opcodes are suspect.

I agree, however, that "unexpected errors" are bugs.

PS. Yes, I know, some programming languages are perverse enough that the
code above makes sense.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.