Checked vs unchecked exceptions

Ola Fosheim Grøstad via Digitalmars-d digitalmars-d at puremagic.com
Sun Jun 25 12:29:15 PDT 2017


On Sunday, 25 June 2017 at 17:38:14 UTC, mckoder wrote:
> Exceptions that can be thrown by a method should be part of the 
> contract of that method. Changing the list of the list of 
> exceptions that can be thrown by a method is just like changing 
> the parameters of the method. This is something that should 
> cause calling code to fail to compile. This will allow you to 
> inspect the calling code and decode how to deal with the new 
> exception.

I think the reason it didn't work out for C++ to specify the 
exceptions is that you need good IDE support for it and C++ was 
to a large extent a language where people wrote code in basic 
editors.

> message. I have a lot of respect for Anders Hejlsberg (my first 
> programming language was Turbo Pascal) but he is completely 
> wrong on this topic.

Turbo Pascal as a language was so-so, but the IDE was very 
productive.



More information about the Digitalmars-d mailing list