4 ms·
I think you are missing something, at least on the "ideological" aspect of things: it's part of the values/guarantees of Zig that all control flow is going to b
by Zababa 5y ago
I think you are missing something, at least on the "ideological" aspect of things: it's part of the values/guarantees of Zig that all control flow is going to be explicit. On the landing page of Zig (https://ziglang.org/ https://ziglang.org/), "No hidden control flow." is the first bullet point. So "try" is the way they found to make control flow explicit, but also less painful that if (...) { return something; }. It's also a solution that's checked by the type system, exceptions usually aren't.
I don't know if it's the best solution, but I can understand where they come from.