3 ms·
> Result types genuinely are better. Only if there’s a language support for them. Like Rust, where I can concisely drop out of function if it’s an error case.
by wiseowise 3y ago
> Result types genuinely are better.
Only if there’s a language support for them. Like Rust, where I can concisely drop out of function if it’s an error case.
https://web.mit.edu/rust-lang_v1.25/arch/amd64_ubuntu1404/share/doc/rust/html/std/result/index.html#the-question-mark-operator- https://web.mit.edu/rust-lang_v1.25/arch/amd64_ubuntu1404/sh...
If I have to constantly write
when(result) {
Ok -> …
Err -> …
}
then checked exceptions and throws clause are better.