Asked on Reddit: Which of Rust, D, Go, Nim, and Crystal is the strongest and why?

Dave via Digitalmars-d digitalmars-d at puremagic.com
Wed Jun 10 12:55:59 PDT 2015


> I usually agree that the more restrictive option should be the 
> default, but exceptions is... well... the exception. The whole 
> point of the exceptions system is to limit the number of points 
> where you need to worry about something going wrong to the 
> place where it happens and the places where you want to do 
> something special with it.

The point of exceptions is to communicate errors and where they
originate. As long as this is respected, then I am not following
your complaint.

> you have to care about the exception at every single point in 
> between.

That's the point. If you don't annotate the function (with a
throw keyword for instance), then you are forced to catch and
handle the exception. If you annotate it (saying this function 
will throw), no catch is needed, but at least you are 
communicating to the next layer that
this code *does* have errors that should be accounted for.

> nothrow by default means you can't do that

Actually no guarantees by default means you can't do what I 
explained above.


More information about the Digitalmars-d mailing list