from Hacker News

I Want Off Mr. Golang's Wild Ride (2022)

by wheresvic4 on 7/25/23, 4:48 PM with 37 comments

  • by tikhonj on 7/25/23, 5:39 PM

    The April 2022 update at the end of the article has a good short summary:

    > If you're looking to reduce the whole discourse to "X vs Y", let it be "serde vs crossing your fingers and hoping user input is well-formed". It is one of the better reductions of the problem: it really is "specifying behavior that should be allowed (and rejecting everything else)" vs "manually checking that everything is fine in a thousand tiny steps", which inevitably results in missed combinations because the human brain is not designed to hold graphs that big.

    My pet theory is that this corresponds to the "two cultures" of software engineering: do you value up-front work and abstraction to reduce cognitive load and debugging, or would you rather (try to) pay more attention and spend more time debugging to reduce how much you have to learn and think up-front? Go seems pretty firmly in the latter camp. That's exactly why I am not interested in the language either, despite the various things it gets right.

  • by gnfargbl on 7/25/23, 5:34 PM

    I have created and maintain a 130k SLOC Go codebase over the last four years or so, and there are a number of things about Go that irritate the shit out of me. I still get bitten by taking the address of a loop temporary on a surprising basis, for example, even though I am acutely aware of the issue. Or, I haven't really found any use for generics yet, because (as best I can tell) it's impossible to specialise and pretty much every potential use-case I have found for generics so far seems to boil down to lots of shared functions and a few specialised functions.

    None of those real irritations are addressed in this article, which seems to be an extended complaint that Go isn't as portable between Linux and Windows as the author would like it to be. If you're unfamiliar with Go and attempting to evaluate the language, there's not much in here that I could recommend one way or the other. You would be better spending the time on doing the Tour of Go, then reading one of the various "pitfalls" articles.

  • by andrewfromx on 7/25/23, 5:36 PM

    Like all languages you can make a mess or make something wonderful. It's also really hard to remove your own bias from the project itself and the drama (or lackthereof). I happen to love go, honey moon started in 2016 and hasn't stopped for me yet. Today's commits: https://github.com/andrewarrow/settle-down/tree/main/app

    Start at welcome_controller.go and follow the flow. Notice no structs for the sake of structs I make heavy use of map[string]any which serializes to json so nicely without any `json` modifiers.

  • by progbits on 7/25/23, 5:36 PM

    Previous discussion with 400 comments:

    https://news.ycombinator.com/item?id=31191700

  • by winstonprivacy on 7/25/23, 5:56 PM

    Ah, Go. I wrote a whole networking stack in it a few years back. I admit, I did get an incredible amount of performance from a very limited bit of hardware with it. However, it was dependency and module hell. Even the Go expert couldn't get it figured out enough to make it compile every time.

    I'm really glad I got off that ride.

  • by boarnoah on 7/25/23, 5:42 PM

    Doesn't rust suffer from the same, way too wide dependency web?

    I feel like its an unfortunate consequence of having a good package manager which encourages proliferation of too many very small dependencies.

  • by Night_Thastus on 7/25/23, 6:17 PM

    The more I read about Rust, the more I've come to respect it. I still think:

    * It's a specialized tool not suitable for all (or even most) projects

    * It needs a bit more time to both develop as a language and ecosystem

    But it's clear that it's not half-assed and a lot of thought went into it.

    Interesting to hear about Go's development as well. It was starting to pick up when I was in college, and now it's had a few more years. Bit disappointing to see it's so messy.

  • by nunez on 7/26/23, 12:54 AM

    I'm surprised the author didn't talk about error handling in Go.

    That is, by far, my biggest pet peeve with the language.

    Most languages have try/catch patterns, but Go opted for multivariate returns and a discrete error type...without pattern matching!

    At least 20% of Golang code I look at is the if err != nil pattern, which is a crazy amount of repetitive boilerplate. I don't think the must pattern is a good alternative either in many cases.

  • by divan on 7/25/23, 5:59 PM

    I see "How to complain about Go" (2015) [1] needs an update.

    [1] https://medium.com/@divan/how-to-complain-about-go-349013e06...

  • by nunez on 7/26/23, 12:48 AM

    Great article.

    This opinionation runs deep into the Kubernetes ecosystem as well (one of, if not the, biggest Golang project out there).

    Here is an example: https://github.com/kubernetes/kubernetes/issues/53533

  • by nvy on 7/25/23, 6:06 PM

    Meta: does flagging and vouching work differently for links than for comments?

    This account has enough karma for flagging, and I can see the title of this submission is prefixed with [Flagged] but I don't have an option to Vouch.

    How does that work? I flag/vouch pretty rarely so I'm not always sure.

  • by dankobgd on 7/30/23, 4:25 PM

    i knew it was about rust before i even opened this
  • by papichulo2023 on 7/25/23, 5:35 PM

    More like a multiplatoform Go vs Rust comparation. Tbh I wouldnt pick Go if the software needs to run on Windows.
  • by Sukera on 7/25/23, 5:28 PM

    (2020)
  • by Gordonjcp on 7/25/23, 5:51 PM

    Mostly this article seems to be whining about Go's file handling being more based around Unix-y stuff, and not really being suitable for Windows file systems.

    So what? If you don't use it as intended, it might not do what you want. Don't use it on unsupported niche operating systems.