Program logic bugs vs input/environmental errors

eles via Digitalmars-d digitalmars-d at puremagic.com
Fri Oct 3 21:10:49 PDT 2014


On Saturday, 4 October 2014 at 03:16:08 UTC, ketmar via 
Digitalmars-d wrote:
> On Fri, 03 Oct 2014 19:25:53 -0700
> Brad Roberts via Digitalmars-d <digitalmars-d at puremagic.com> 
> wrote:
>
>> Where's the contradiction?  The compilers state hasn't been 
>> corrupted just because it encounters errors in the text file.
> but compiler is in unknown state.

It's not. It just detected that another system would enter in an 
unknown state if built. The compiler is like the engineer that 
examines the design of a project and discovers an error on it, so 
it refuses to build the product. Is the engineer in an unknown 
state?

No, it is, just like the compiler is, outside its/his/her normal 
execution flow, wich is "take the design and build the product". 
It is a known state of the compiler/engineer, namely the error 
processing path.

While on the error processing path you allow yourself to be 
slower and take time to guess. This is important. Just as for the 
engineer, this will educate the designers and will not come again 
so often with the same design mistake. Then, working/building 
fast is measured on the normal execution path, not on the error 
recovery path since the latters is assumed to occur quite rarely 
(in any case, its seen like an exceptional issue).

Of course, the engineer has to handle the work conflict with the 
designer in a polite form. For the compiler this means printing a 
nice error message to the user.

Guessing might not be good, but it is nice effort to do. Do you 
really miss the super-cryptic C (let's not even talk about C++) 
error messages that you sometimes receive?


More information about the Digitalmars-d mailing list