3 ms·
I don't know Rust well, but my understanding is the Rust way is better than Java or C++. Exceptions are a mess. Either you go the Java route of tagging everyt
by asveikau 7y ago
I don't know Rust well, but my understanding is the Rust way is better than Java or C++.
Exceptions are a mess. Either you go the Java route of tagging everything as throwing every subclass of Exception under the sun (which encourages people to write empty catch blocks to silence a noisy compiler), or you go the C++ route where you are not totally clear an error can occur when writing the code or from glancing at it. (Combine with operator overloading for most confusing results.)
Having an error result that can perhaps be easily propagated to the caller is the best of both worlds, and I think is the thing that good C code tries to approximate in a more manual way.