Re: Handling invalid objects



Justin Gombos <rpbkbq.xax.gld@xxxxxxxx> writes:

Exception raising and handling is often viewed as writing code that
will never execute. Predefined exceptions must be handled when
there is an expectation they will be raised, but their usefullness
stops there. Beyond that, it's like writing erroneous code on
purpose.

Code that _should_ never execute, perhaps!

Exceptions are for things that can't be handled locally because of
lack of application knowledge. For example, how to handle a
Socket_Error?

And also, I think, for contract violation, where the contract can;t be
enforced in the language. Now we can say 'not null access' but in
Ada95 we can't.

There are cases where exceptions are outlawed; most of them are not
justified. Even if they were all justified, advocating a return to
the mess that error codes create is not a viable option.

It's a mess regardless. Clearly Ada is deficient in this respect,
as all languages seem to be.

I think it's called living in the real world.
.



Relevant Pages

  • Re: performance
    ... efficient language and still have an inefficient system. ... > Even on these super performant silicons, some kernel code and device drivers ... > exceptions. ... > relates to the efficiency/performance of the libraries ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Please explain the meaning of stealing a ref
    ... points of connotation as well as denotation in phrasing, and language ... clearer to _other_ readers, ... No, the use of the word 'exceptions' is anything but unreasonable, ... "Owning a reference" means being ...
    (comp.lang.python)
  • Re: UML Question (Object <-> ObjectFinder?)
    ... It also seems to me that the formality of one's language ... >the problem space one is defining constraints on behavior sequencing ... >> emulate the computing environment of those languages. ... Any language that can execute has some underlying assumptions about ...
    (comp.object)
  • Re: performance
    ... > for kernel mode device drivers, while it's much easier to use C++ they ... > exceptions. ... ** I don't confuse language and policies, ... template libraries and no C++ exceptions. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: OS Threads behavior
    ... > might run at higher priorities than your threads. ... >>I care about it, since I need it, "This answer is so famelies in Microsoft ... >> heavy tools in this language, the language does not support Hardware ... it's the OS the one who decide which thread to execute. ...
    (microsoft.public.dotnet.languages.csharp)