[OT] - C++ exceptions are becoming more and more problematic
Atila Neves
atila.neves at gmail.com
Thu Mar 3 12:05:11 UTC 2022
On Friday, 25 February 2022 at 00:30:49 UTC, H. S. Teoh wrote:
> On Thu, Feb 24, 2022 at 11:59:56PM +0000, meta via
> Digitalmars-d wrote: [...]
>> Nobody said to verbatim copy what C does, I personally
>> explicitly said to take that idea and evolve it, just like the
>> newer modern languages are properly doing (Go, Zig, Rust, Odin)
>
> Go, Zig, Rust, and Odin all require explicit checking for error
> returns.
Nope:
http://web.mit.edu/rust-lang_v1.25/arch/amd64_ubuntu1404/share/doc/rust/html/reference/expressions/operator-expr.html#the-question-mark-operator
Years ago, I justified my preference for exceptions because the
rest of the call stack didn't have to be cluttered with
"rethrowing". Having to pattern match is better, but still a
pain. The macro solution they went with is the only one I know of
that is as easy to use as exceptions without the associated
baggage.
Atila
More information about the Digitalmars-d
mailing list