www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Re: Suggestion: Syntactic sugar for Exception handling in D2

 I suggest looking at D's scope guard statements, which replace most uses 
 of try statements.

As I've written in a few other places in the thread now, it's not about lacking other solutions to the problem. Scope guards and the existing exception-handling do cover all possible cases. It's neither about fear of wearing out my bracket-keys. It's merely about readability, and slightly shifting how the language affect how developers think about exception handling, trying to make exception-cases a natural but separate part of each method (1). I think I'm already seeing that same reasoing for a few other features in D, such as the contract and unittest-constructs in the language. But those values are highly subjective, and how the language affect the mindset is also very difficult to assess and value without working with it for a while. 1) I've completely abandoned the idea for other blocks than methods. It was a bad idea from start, just ambiguous and doesn't make sense at all.
Jun 23 2009