DConf 2013 Day 3 Talk 2: Code Analysis for D with AnalyzeD by Stefan Rohe

Ary Borenszweig ary at esperanto.org.ar
Wed Jun 12 15:03:15 PDT 2013


On 6/12/13 6:49 PM, bearophile wrote:
> Ary Borenszweig:
>
>>> Maybe checked exceptions are bad only for the type system of Java. Maybe
>>> for a language that has global type inferencing on the exceptions such
>>> feature becomes better.
>>
>> Why?
>
> I am not an expert of type systems, so this is this just an hypothesis.
> What are the disadvantages of checked exceptions? One problem is that
> those annotations are heavy, make the code rigid to change, and this
> doesn't go well with normal programmer laziness. A global type
> inferencer (that doesn't work well with the dynamic nature of Java)
> avoids the need for all exception annotations, but forces you to catch
> exceptions somewhere, assuring no holes remain if you don't want holes.
>
> Bye,
> bearophile

But if a type checker deduces a function foo throws exception A, and in 
function bar you call foo: are you forced to handle the exception? If 
not, do you have to tell the compiler that you don't want to handle that 
exception? Isn't that the same as what Java does?


More information about the Digitalmars-d-announce mailing list