Rethrow an exception like in C++?

Jonathan M Davis jmdavisProg at gmx.com
Fri Mar 8 10:49:44 PST 2013


On Friday, March 08, 2013 18:32:43 Rob T wrote:
> The point I'm trying to illustrate is difficult to understand
> unless you have to personally implement 1000 try/catch statements
> in your code base. You'll never know how a seemingly trivial item
> like re-specifying the same pointless catch statement over and
> over and over again quickly adds up and the frustration knowing
> that there's a simple solution at hand, but it's not available in
> what is otherwise a much better language than the one that has
> the solution.

Except that the C++ one is just as pointless. In both cases, you're telling it 
to catch everything. It's just that syntax is slightly different, because D 
doesn't allow you to throw without an explicit variable. And it's only a 
handful of characters difference in length. So, to some of us at least, it 
seems like you're blowing things out of proportion. And given the lack of 
clarity in the C++ solution, it comes off as being worse from a technical 
perspective, regardless of the typing involved.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list