• onlinepersona
    link
    fedilink
    English
    arrow-up
    19
    arrow-down
    3
    ·
    8 hours ago

    I honestly don’t get why people like Go. Structural typing makes it so difficult to find classes that interpret an interface. Every dumb go project has to be opened in an IDE or something with a language server to find implementors of an interface. Also, forcing every capitalised object in a module or struct to be exported is just… wat? Returning a tuple of whatever, err also feels wrong. It’s like they couldn’t decide between throwing exceptions or an enum and went with something in between.

    I get that the inbuilt concurrency features are nice, but the rest of the language and stdlib feel very lackluster. At least that’s my impression after ~2 weeks of it. My retreat to Rust was rather quick.

    Anti Commercial-AI license

    • SilverShark
      link
      fedilink
      arrow-up
      2
      ·
      3 hours 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.

      • BatmanAoD
        link
        fedilink
        arrow-up
        5
        ·
        3 hours 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.)

        • SilverShark
          link
          fedilink
          arrow-up
          2
          ·
          3 hours ago

          Yes, true. Having it built in in the compilation would be nice. Or at least having errcheck as a tool which already comes packed with Go.

          Go has changed over time to include more things like this. Maybe one day this will be addressed.

          • BatmanAoD
            link
            fedilink
            arrow-up
            1
            ·
            1 hour ago

            Yeah, I was particularly glad to see the change in loop variable semantics become a stable part of the language. That was a terrible footgun.

            There are other things I dislike about Go, but I do think it’s improving while maintaining its better qualities, which is no small feat.

    • thingsiplay@beehaw.org
      link
      fedilink
      arrow-up
      6
      ·
      5 hours ago

      I’m in a similar position. I tried Go too, but its not a fun language to work with for me. But I get what they are aiming for, a very simplistic language without too many features or structures, inspired by C itself. In fact one of the Go language developers is Ken Thompson, who developed C language itself too.

      And you know what, that’s fine. Not every language has to offer everything. There are huge portion of people who like this approach. You can easily begin programming in Go, after a few hours or days of learning. There is really not much from language perspective to learn. I don’t have to like it, but others do, and that’s fine.

      If anything, I would look at Zig instead Go. Zig is also not very complicated. Its even closer to C and can run C code directly. Its kinda the child of C and Rust.

      • esa@discuss.tchncs.de
        link
        fedilink
        arrow-up
        4
        ·
        edit-2
        3 hours ago

        Yeah, the Go creators seem to generally mean “resembles C” when they use words like “simple”, which could explain stuff like going “why do you need generics when you can just cast?” for, what, ten years?

        I remember trying some Plan9 stuff and bouncing off it, including acme. I guess it’s the kind of thing that makes sense to Pike but not to me. Not sure what gophers in general think of it (but wikipedia lists at least Russ Cox as a user).

        • thingsiplay@beehaw.org
          link
          fedilink
          arrow-up
          2
          ·
          3 hours ago

          And the Garbage Collector in Go is also a thing that helps ton for most normal work. To be honest, I wish sometimes Rust had an optional GC mode (I know this would be against the principles of the language… don’t take this wish too seriously). I see it like C with a GC+Concurrency. And one should not forget, because the language is dead simple, the compiler compiles extremely fast; even suitable as an interpreter language basically (purely judging by speed metrics).

          But after being exposed to Rust, I do not have fun with Go because it misses some really cool or basic functionality; like proper error handling. Ultimately these are different approaches and that’s good. In example functional programming works a bit differently and we are not saying they should give up on this approach, because you like C so much.

          • Ephera@lemmy.ml
            link
            fedilink
            English
            arrow-up
            1
            ·
            7 minutes ago

            To be honest, I wish sometimes Rust had an optional GC mode (I know this would be against the principles of the language… don’t take this wish too seriously).

            If you just need the occasional cop-out, you can wrap a value in an Rc or an Arc. They do reference-counting, which is almost like garbage collection (reference counting can’t resolve cycles between references).

          • esa@discuss.tchncs.de
            link
            fedilink
            arrow-up
            2
            ·
            edit-2
            2 hours ago

            Yeah, Rust is ultimately a different project than Go, and I suspect much of the success of Go is down to stuff like good tooling, default GC, native static binaries, generally easy concurrency, rather than stuff like having as bare-bones a language as otherwise possible. I’d suspect having a focus on fast compilation also helps draw in people from interpreted languages.

            It’s easy to write a Kubernetes microservice that performs adequately with Go, and that’s all a lot of people & teams need.