News for hackers. Stuff that matters.
Re:The Year of C++ Successor Languages by ginsider_oaks on Monday January 02, 2023 @10:46AM (#34219128)
They're not conflating.

mgaunard says:

> The alternative that the parent said was making all of your state be a union > with some kind of error, and making sure all accesses handle the fact the > variable might be in a erroneous state.

This is exactly what `Result` is in Rust. While I haven't used Rust, it seems that panics are generally discouraged and only used as a last resort whereas exceptions are more commonly used in C++ and Java.

Re:The Year of C++ Successor Languages by menaerus on Monday January 02, 2023 @12:25PM (#34220658)
Yes, they are. They are basing their argument by comparing Rust Result against C++ exceptions in the context of general error handling whereas I pointed out that there are actually two classes of errors and both of which are addressed their own appropriate mechanisms in both Rust and C++.

What parent comment tried to (wrongly) imply, and your comment as well, is that exceptions in C++ are (commonly) used as a control flow mechanism. And they are not.