Feedback from the Gripes and Wishes Campaign

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Tue May 30 05:41:14 UTC 2023


On 30/05/2023 9:18 AM, Ernesto Castellotti wrote:
> Mainly because exceptions are often used for errors that aren't really 
> exceptional", I often found myself having to handle exceptions (mostly 
> in Java and C++) that really didn't give a damn and just abort the program.

There are three categories that exceptions tend to fall into from what 
I've been able to tell.

1. Errors, show stoppers (use assert)
2. Genuinely exceptional, can stop program if not handled (use runtime 
exceptions)
3. Exceptional path ways, should not stop the program and needs to be 
handled close to throw (use value type exceptions)

A large portion of standard library stuff should really fall into the 
third, not the first or second IMO. Whereas runtime + threading should 
fall into first and second.


More information about the Digitalmars-d mailing list