• SilverShark@programming.dev
    link
    fedilink
    arrow-up
    1
    ·
    2 months ago

    The stdlib I actually find quite complete. Especially for http projects. You really don’t need third party libs for that for example.

    The errors were super strange to me at the start, but I’ve come to really like it over exceptions. It is similar to old error codes, but I feel that this makes one always have to be mindful of error handling and the non happy path (thinking of large Python projects where no one cares about exceptions).

    A lot of people tend to compare Go and Rust, but I feel that the languages are just too different. Rust is good for a variety of things which don’t overlap with the things Go is good for.

    • deadcream@sopuli.xyz
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      2 months ago

      What I don’t like about Go’s error handling is that it’s built on returning a tuple of result/error instead of enum/union/variant/whatever-its-called. Which means that on error path you have to return something for successful result too (usually a “zero-initialized” struct because Go doesn’t have optionals). You are not returning result or error, you are always returning both. This is just wrong.

    • BatmanAoD@programming.dev
      link
      fedilink
      arrow-up
      1
      ·
      2 months ago

      It is similar to old error codes, but I feel that this makes one always have to be mindful of error handling and the non happy path

      Technically you need a separate linter (errcheck) to ensure you don’t just ignore errors. This is…not great. (That should have been a compiler error.)