Exception programming difficult

Manipulator volcz at kth.se
Thu Aug 16 06:11:41 PDT 2012


I had times when I missed the Java-style Exception handling.

First time I just the D sockets exceptions was thrown during 
runtime. The Library Reference didn't tell my anything about 
exceptions neither did the compiler.
This could've been avoided with documentation stating which 
exceptions can be thrown or if the compiler had warned me about 
it.
I see checked exception handling as mean to remind programmers to 
handle certain errors. This is not done in D.

I've also cursed the Java-style many times. For example:
interface MyInterface {
  public void method throws IOException();
}

class MyClass implements MyInterface {
  public void method throws IOException() {
   //Doesn't need throw IOException!!!!
  }
}

I liked the idea when the compiler is able to warn me about 
unhandled exceptions.



More information about the Digitalmars-d mailing list