• Ananace@lemmy.ananace.dev
    link
    fedilink
    arrow-up
    62
    ·
    6 months ago

    Go really does do well in the zero-to-hero case, that’s for certain. Unfortunately it doesn’t fare nearly as well in terms of ease when it comes to continued development.

    • z3rOR0ne@lemmy.ml
      link
      fedilink
      arrow-up
      17
      ·
      6 months ago

      I’m a beginner in both (heavily leaning towards putting more time into learning Rust though). Could you please elaborate a bit?

      • Ananace@lemmy.ananace.dev
        link
        fedilink
        arrow-up
        35
        arrow-down
        2
        ·
        6 months ago

        Go has a heavy focus on simplicity and ease-of-use by hiding away complexity through abstractions, something that makes it an excellent language for getting to the minimum-viable-product point. Which I definitely applaud it for, it can be a true joy to code an initial implementation in it.

        The issue with hiding complexity like such is when you reach the limit of the provided abstractions, something that will inevitably happen when your project reaches a certain size. For many languages (like C/C++, Ruby, Python, etc) there’s an option to - at that point - skip the abstractions and instead code directly against the underlying layers, but Go doesn’t actually have that option.
        One result of this is that many enterprise-sized Go projects have had to - in pure desperation - hire the people who designed Go in the first place, just to get the necessary expertice to be able to continue development.

        Here’s one example in the form of a blog - with some examples of where hidden complexity can cause issues in the longer term; https://fasterthanli.me/articles/i-want-off-mr-golangs-wild-ride

      • Ephera@lemmy.ml
        link
        fedilink
        arrow-up
        9
        ·
        6 months ago

        Another reason is kind of a general thing with programming language design: Go, like Java or C, has relatively few concepts in the language and stdlib. This means you’re relatively quick to have seen all of them.

        But this also means that for various tasks, these concepts that were left out, would have been the right tool. For example, Go doesn’t have enums.

        Generally, it’s still possible to create all possible programs, because of turing-completeness, but it will be more cumbersome and more boilerplate-heavy.

        So, as a rule of thumb, the more concepts are provided by the language and stdlib, the more you have to learn upfront, but the less pain you have long-term.

      • Ethan@programming.dev
        link
        fedilink
        English
        arrow-up
        10
        arrow-down
        8
        ·
        6 months ago

        Ananace and the article they linked are using their dislike of Go to conclude that it’s a bad language*. It is not a bad language. Every language has hidden complexity and foot guns. They don’t like Go. Maybe you won’t like Go. That’s ok. But that doesn’t make Go a bad language. The language designers are very opinionated and you might dislike them and their decisions.

        I haven’t used Rust but from what I’ve seen, it’s a lot less readable than Go. And the only thing more important than readability is whether or not the code does what it’s supposed to do. For that reason I doubt I’ll ever use Rust outside of specific circumstances.

        *I’m using “a bad language” as shorthand for “a language you shouldn’t use”. Maybe they don’t think it’s bad but amounts to the same thing.

        • Feathercrown@lemmy.world
          link
          fedilink
          English
          arrow-up
          17
          ·
          6 months ago

          And the only thing more important than readability is whether or not the code does what it’s supposed to do.

          Isn’t that exactly what Rust is supposed to be good at

          • arendjr@programming.dev
            link
            fedilink
            arrow-up
            13
            arrow-down
            1
            ·
            6 months ago

            And conversely, something Go is very bad at. For example, os.Chmod silently not doing anything on Windows.

    • andrew@lemmy.stuart.fun
      link
      fedilink
      English
      arrow-up
      13
      ·
      6 months ago

      Is there a language that anyone would say really does fare well for continued development or is it just that few people enjoy maintaining code? I’ve maintained some pretty old Go programs I wrote and didn’t mind it at all. I’ve inherited some brand new ones and wanted to rage quit immediately. I’ve also hated my own code too, so it’s not just whether or not I wrote it.

      I have found maintainability is vastly more about the abstractions and architecture (modules and cohesive design etc) chosen than it is about the language.

      • BatmanAoD@programming.dev
        link
        fedilink
        arrow-up
        22
        ·
        6 months ago

        Rust is extremely geared toward maintainability at the cost of other values such as learnability and iteration speed. Whether it’s successful is of course somewhat a matter of opinion (at least until we figure out how to do good quantitative studies on software maintainability), and it is of course possible to write brittle Rust code. But it does make a lot of common errors (including ones Go facilitates) hard or impossible to replicate.

        It also strongly pushes toward specific types of abstractions and architectural decisions, which is pretty unique among mainstream languages, and is of course a large part of what critics dislike about it (since that’s extremely limiting compared to the freedom most languages give you). But the ability for the compiler to influence the high-level design and code organization is a large part of what makes Rust uniquely maintainability-focused, at least in theory.

      • kaffiene@lemmy.world
        link
        fedilink
        English
        arrow-up
        9
        ·
        6 months ago

        If I’m going to inherit a large code base to maintain, I’d like Java, C# the most, Python, the least. Go isnt too bad IMO. I’ve not worked with enough Rust code to really judge it. BTW I like Python but lack of types makes refactoring and discoverability harder

  • Fal@yiffit.net
    link
    fedilink
    English
    arrow-up
    24
    arrow-down
    56
    ·
    7 months ago

    Terrible meme. Go is bad and you should feel bad

    • TheEntity@lemmy.world
      link
      fedilink
      arrow-up
      66
      arrow-down
      3
      ·
      edit-2
      6 months ago

      Go is like that abusive partner that gives you flowers and the next day makes you feel like shit. Then another day you go to an expensive restaurant and you tell yourself that maybe it’s not so bad and they still care. And the cycle continues.

      Rust is an autistic partner that sometimes struggles with telling you how much they care, is often overly pedantic about technical correctness and easily gets sidetracked by details, but with some genuine effort from both sides it’s very much a workable relationship.

      • Technus@lemmy.zip
        link
        fedilink
        arrow-up
        46
        arrow-down
        3
        ·
        7 months ago

        Yeah but Go has the best error handling paradigm of any programming language ever created:

        ret, err := do_thing()
        
        if err != nil {
            return nil, err
        }
        

        Don’t you just love doing that every 5 lines of code?

        • kaffiene@lemmy.world
          link
          fedilink
          English
          arrow-up
          6
          ·
          6 months ago

          I actually reasonably like Go. It’s simple and pragmatic but I fucking loathe its error handling. To me it just replicates one of the worst features of C

        • sunbeam60@lemmy.one
          link
          fedilink
          arrow-up
          4
          ·
          edit-2
          6 months ago

          I do think Zig is better for this kind of thing.

          const ret = try do_thing();
          
          if( ret ) | result | {
             do_something_with_result(result);
          }
          

          The try keyword returns any error up; the if-unwrap works with what came out of a successful call. Normally you wouldn’t have both, of course.

          do_thing would be defined as a union of an error (a distinct kind of type, so it can be reasoned about with try, catch and unwrapping) and the wrapped return value.

          • TheEntity@lemmy.world
            link
            fedilink
            arrow-up
            21
            arrow-down
            1
            ·
            7 months ago

            With some sprinkle of libraries such as anyhow and thiserror the Rust errors become actually pleasant to use. The vanilla way is indeed painful when you start handling more than one type of error at a time.

            • Fal@yiffit.net
              link
              fedilink
              English
              arrow-up
              6
              arrow-down
              1
              ·
              6 months ago

              Exactly this. Anyhow makes error handling in rust actually a joy. It’s only something you need to consider if you’re writing a library for others to use, and in that case, it’s good that rust forces you to be very very explicit

        • Shareni@programming.dev
          link
          fedilink
          arrow-up
          13
          arrow-down
          14
          ·
          7 months ago

          It’s not pretty, but it’s uniform, obvious, and easy to understand.

          go is good grug friend who chase away complexity demon by limit damage of big brain developer

    • kaffiene@lemmy.world
      link
      fedilink
      English
      arrow-up
      2
      ·
      6 months ago

      I think I’d rather code in Go than Rust. But I’m not a great Rust programmer so my opinion may not count. I can code effectively in C, C++, Go, Java, C#, Python, and a few others, but Rust is the only language that I find hard to use. I’m probably just dumb

      • zinderic@programming.devOP
        link
        fedilink
        arrow-up
        3
        ·
        6 months ago

        You’re not dumb. Rust is a hard language to pick. Some people probably think I’m mocking it because I made this meme but I’m really not - I love Rust. I’m mocking us mere humans trying to cope with greatness 🤣And I’m looking forward to the time when I finally “graduate” and become more productive and experienced with Rust.

      • Fal@yiffit.net
        link
        fedilink
        English
        arrow-up
        2
        arrow-down
        4
        ·
        6 months ago

        Are you using an IDE like rustrover? Rust is by far the easiest language I’ve worked with. It makes it so the only way to write code is the right way

        • kaffiene@lemmy.world
          link
          fedilink
          English
          arrow-up
          1
          ·
          6 months ago

          Yes, I was using Rustrover the last time I used Rust. VSCode previously. I’ve tried to get into Rust a few times and really just failed repeatedly. Ill probably try again at some point but my experience thus far hasn’t been great