[OT] - C++ exceptions are becoming more and more problematic

Commander Zot zot at zot.zot
Thu Feb 24 10:36:48 UTC 2022


On Thursday, 24 February 2022 at 00:19:44 UTC, meta wrote:
>> Support struct based exceptions (value type), passed on stack 
>> (and hence RC support) as part of the return value of a 
>> function.
>
>
> Who will allocates that (the RC part)?
>
> I personally disagree with the idea of exceptions altogether..
>
>
> The answer is in solutions like in Zig/Go, errors, multiple 
> return values, if changing the way error handling works in D, 
> better make it good, for good!

oh god, go code is so stupid to read b/c theres error handling 
everywhere mixed with code logic. i'm all for adding multiple 
return values, aka tuples, but exceptions are by far the best 
error handling method by readability. also you are forced to 
catch them and you got stack traces, which is super useful.


Zot


More information about the Digitalmars-d mailing list