3 ms·
Emil has been working in Rust for eight years. Hardly a honeymoon phase. As for your accusation of lying: I cannot imagine where you’ve pulled that from. Emil’
by chrismorgan 4y ago
Emil has been working in Rust for eight years. Hardly a honeymoon phase.
As for your accusation of lying: I cannot imagine where you’ve pulled that from. Emil’s description of unchecked exceptions as invisible errors insofar as you can’t see where errors might occur from the source code alone is objectively an accurate and reasonable description.
- hota_mazi 4y agoExcept Emil is talking about "Java exceptions", not "Java runtime exceptions". Because Java's checked exceptions have the exact same good qualities that Rust's question mark operator offers.
- jrpelkonen 4y agoAgreed, checked exceptions surface potential errors to the caller. In that regard Java fares better. However, handling exceptions still require a separate catch clause rather than being part of the normal flow. Furthermore, it is nigh impossible to rely on checked exceptions alone, most Java code may throw RuntimeExceptions such as NullPointerException or ArrayIndexOutOfBoundsException and there is no way to know it by just looking at the calling code.
- hota_mazi 4y ago> However, handling exceptions still require a separate catch clause rather than being part of the normal flow Only if you want to catch (handle) it. If you don't want to do that, just declare it in your "throws" clause and enjoy writing your code with the (guaranteed) assumption that you are using a valid value. > Furthermore, it is nigh impossible to rely on checked exceptions alone, most Java code may throw RuntimeExceptions such as NullPointerException or ArrayIndexOutOfBoundsException and there is no way to know it by just looking at the calling code. That's a bug, not a feature. These errors are often unrecoverable, hence why they are runtime and not checked.