• r1veRRR@feddit.de
    link
    fedilink
    arrow-up
    21
    arrow-down
    1
    ·
    11 个月前

    It’s better than “invisible” exceptions, but it’s still the worst “better” version. The best solution is some version of the good old Result monad. Rust has the BEST error handling (at least in the languages i know). You must handle Errors, BUT they are just values, AND there’s a easy, non-verbose way of passing on the error (the ? operator).

    • theneverfox@pawb.social
      link
      fedilink
      English
      arrow-up
      1
      ·
      edit-2
      11 个月前

      Beyond a quick “hello world” when it came out, I’ve never used rust, but that sounds pretty great