3 ms·
A distinction without a difference, because "panics" and "exceptions" are literally the same code under the hood of the compiler and standard library. Fragile
by otabdeveloper4 4y ago
A distinction without a difference, because "panics" and "exceptions" are literally the same code under the hood of the compiler and standard library.
Fragile run-time behavior and unmaintainable code is because programming is hard and cruft accumulates in the face of difficult requirements.
Renaming a thing that traumatized you in the past won't make the cause of the trauma go away.
- milesedgeworth 4y agoAlthough the code generated might be similar, it's not a "distinction without a difference" because the language doesn't provide the same tools for interacting with panics as say C++ does with exceptions. There is no "try catch" for panics, you either catch them at the thread boundary or catch them with catch_unwind. Everything in the std lib is built with Result for errors that can be handled, not panic. Programming is hard, but that doesn't mean that certain language design choices don't have meaningful impact on what type of code becomes easier/harder to write. Other people are saying similar things, and I ask you listen to what they're saying, rather than talking about people being "traumatized" by a programming construct.
- otabdeveloper4 4y ago> you either catch them at the thread boundary or catch them with catch_unwind So exactly like C++ exceptions then?