<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 6, 2014 at 6:19 PM, Andrei Alexandrescu via Digitalmars-d <span dir="ltr"><<a href="mailto:digitalmars-d@puremagic.com" target="_blank">digitalmars-d@puremagic.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 10/6/14, 4:46 PM, Jeremy Powers via Digitalmars-d wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
On Mon, Oct 6, 2014 at 7:50 AM, Andrei Alexandrescu via Digitalmars-d<br></span><span class="">
    I'm thinking a simple key-value store Variant[string] would<br>
    accommodate any state needed for differentiating among exception<br>
    kinds whenever that's necessary.<br>
<br>
<br></span><span class="">
And 'kinds' is a synonym for 'types' - You can have different kinds of<br>
problems, so you raise them with different kinds of exceptions.<br>
<br>
s/kind/type/g and the question is: why not leverage the type system?<br>
</span></blockquote>
<br>
I've used "kinds" intentionally there. My basic thesis here is I haven't seen any systematic and successful use of exception hierarchies in 20 years. In rare scattered cases I've seen a couple of multiple "catch"es, and even those could have been helped by the use of a more flat handling. You'd think in 20 years some good systematic use of the feature would come forward. It's probably time to put exception hierarchies in the "emperor's clothes" bin.</blockquote><div><br></div><div>Sorry, forgot to respond to this part.</div><div><br></div><div>As mentioned, I'm not a defender of hierarchies per se - but I've not seen any alternate way to accomplish what they give.  I need to know that I am catching exceptions that I can handle, and not catching exceptions I can't/won't handle.  Different components and layers of code have different ideas of what can and should be handled.</div><div><br></div><div>Without particular exception types, how can I know that I am only catching what is appropriate, and not catching and swallowing other problems?</div><div><br></div><div> <br></div></div></div></div>