3 ms·
I don't think this style is much better than exceptions. I think Go could have done itself a favor if it has variants + pattern matching. I find those to be,
by sausagefeet 15y ago
I don't think this style is much better than exceptions. I think Go could have done itself a favor if it has variants + pattern matching. I find those to be, in many cases, superior to exceptions as the compiler checks you are handling everything and you can easily encode success and failure in the variant type.
- vog 15y agoThis is exactly what I observed when using OCaml: Although it provides exceptions, I almost never used them. Most things were a lot simpler to implement via pattern matching (http://caml.inria.fr/pub/docs/oreilly-book/html/book-ora016.html http://caml.inria.fr/pub/docs/oreilly-book/html/book-ora016....).