Question on @nothrow

Mike Parker via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed May 31 01:52:51 PDT 2017


On Wednesday, 31 May 2017 at 08:18:07 UTC, Vasileios 
Anagnostopoulos wrote:
> Hi,
>
> after reading various articles bout the "supposed" drawbacks of 
> checked exceptions I started to have questions on @nothrow. Why 
> there exists and not a @throws annotation enforced by the 
> compiler? I understand that people are divided on checked 
> exceptions and each side has some valid points. But explicitly 
> marking a function as throwing "something" is another subject. 
> Why have the dlang community reached to the decision to use 
> @nothrow and not a @throws?

This has come up several times over the years. For summary, go to 
the search bar and type:

  "checked exceptions" Walter

This will lead you to a number of choice quotes from Walter on 
the topic. Examples:

"C++98 had checked exceptions (exception specifications), too. 
Another failure of the idea, it failed so badly hardly anyone but 
language lawyers ever knew it had it."

"Checked exceptions is another feature that looks great on paper; 
it's only after years of use one discovers what a perniciously 
bad feature it is."

I didn't go further, but there are probably some with more detail 
if you dig, and comments from several others on both sides. 
There's also this article he linked:

http://www.mindview.net/Etc/Discussions/CheckedExceptions


More information about the Digitalmars-d-learn mailing list