from Hacker News

Ten years of “Go: The good, the bad, and the meh”

by jo_beef on 7/18/23, 12:37 PM with 298 comments

  • by wk_end on 7/18/23, 4:58 PM

    > Again, it shows how things have changed that I praised Go’s type inference as an advance in the state of the art, but now the Hacker News crowd considers Go’s type inference to be very limited compared to other languages. "You either die a language nobody uses or live long enough to be one people complain about."

    This rubs me the wrong way. Even back when Go first came out, anyone who knew anything about programming languages rolled their eyes at pretty much everything about Go's type system, including the inference. Just because Sun couldn't figure out how to do it in the 90s doesn't mean that type inference wasn't mostly solved in the 70s. Well before many people were using it or lived any real length of time, Go's always been a language people have - rightly - complained about.

    That said...nothing in the original post says anything along the lines of "Go's type inference [is] an advance in the state of the art", so I might be misunderstanding the author here.

  • by iamcalledrob on 7/18/23, 4:49 PM

    I am immensely thankful for Go.

    The simplicity of the language and the stdlib is shockingly well thought out -- things like io.Reader are so obvious and yet not part of many other languages. The language has made me a better programmer. And the cross-compilation story is chefs kiss.

    Working on a cross-platform project where in Go, I write code and it just builds. In Java, I fight with Gradle. In Swift, I fight the type system and the way everything's constantly deprecated.

    It's not all perfect. I wish the generated binaries were smaller. I wish the protobuf library wasn't awful. And better Cgo/FFI would be nice.

    But overall, I've never been so productive.

  • by bborud on 7/18/23, 4:47 PM

    Go didn't try to be overly clever and abstract. That rubs quite a few people the wrong way, but it also means you are less likely to have to work with people who try to be clever.

    My first reaction when seeing Go is that it smelled of "old fart". It looked straightforward and unexciting. I'm an old fart. I like straightforward and unexciting. It tends to lead to code that I can still read 6 months from now.

    I want to make stuff and not endure people boring me with this weeks clever language hack they came up with that expresses in one unreadable line what could have been expressed clearly in 3 lines.

  • by j1elo on 7/18/23, 5:39 PM

    I'd categorize not being able to convert "unused thing" errors into warnings during development iterations as one of "The Bad".

    Just today I had a couple blocks of code which were causing erratic issues. Wanted to see if it was the second one, so I quickly commented it out. This is just an exploratory development session, no need to comply with code quality guidelines. Still, the code failed to compile because now I had to worry about 8 lines with stuff that had become unused. The stubbornness about not adding an escape hatch for, again, exploratory intermediate development iterations is unnerving.

    "But code should not leave unused stuff around". I agree. That's why after a hundred iterations, in the final compilation phase for production, this kind of errors-are-warnings flag would be disabled.

  • by vl on 7/18/23, 7:01 PM

    The biggest go problem in practice is ironically omitted in both blog posts:

    Verbosity of error handling!

    There should be a shorthand for returning if last ret value is non-nil in one line. Otherwise all you code is littered with:

        if err != nil {
            return err
        }
    
    and it makes it four times as long and way less readable as a result. This needless verbosity really reminds me of Java.

    Also, go fmt is not opinionated enough! There really should be one way to line break and max width. Right now you can't rely on it to magically format it as it "should be" and fire-and-forget when typing.

  • by crop_rotation on 7/18/23, 4:00 PM

    The stdlib is the killer feature of go. Several times I wrote high enough performance small services/servers that people not familiar with go were astounded with (mostly the speed of writing the code and memory usage). I made many go converts this way. And I always only had to use the stdlib (many benefits when writing within a company).
  • by stpedgwdgfhgdd on 7/18/23, 4:31 PM

    Worked with Go over 6 years; my biggest annoyance at the beginning, verbosity of error handling, has mostly gone away. In most cases the explicit error handling helped us hardening the code.

    What does still bother me is the lack of proper enum support. I remember when Java boosted their enum support and the way it impacted the quality of the code. Sure would love to see something similar in Go.

  • by stevemk14ebr on 7/18/23, 6:34 PM

    "What I got right...Using capitalization for the public/private distinction in functions, methods, variables, and fields"

    I disagree with this strongly. Due to this when you need to change one of these things to the opposite it involves changing every use site as well. This has far reaching implications for refactoring, wrapping external code when you really do need to expose its guts, etc. Any time you need to do this in a non-manual fashion you're required to parse all of the code exactly perfectly (ASTs and such). Even go itself has not figured out how to do this, rf is still experimental and not complete: https://pkg.go.dev/rsc.io/rf.

    Example use case: https://github.com/golang/go/issues/46792

    I much prefer the non-viral public/private attributes other languages use.

  • by wolfspaw on 7/18/23, 4:32 PM

    Go has turned into an Awesome language.

    I'm one of those that cannot use a PL that has no generics... It kills the DX of Algorithms and Data Structures.

    Now it has Generics, soft RT GC, and it might even get official Arena Allocation.

    I /LOVED/ the Matklad comment of |error handling converging|, indeed -- it seems that PL community evolved to "any-error" + annotation-at-call-site.

  • by kubb on 7/18/23, 3:43 PM

    Copilot and the like are good for Go, because you can generate all the boilerplate code they make you write.

    As for the success, it's obviously the minimal set of language features, conformance to established paradigms, not being very broken and being backed by Google.

    There's a ton of suboptimal choices in Go, but overall it can work for many applications.

  • by veber-alex on 7/18/23, 4:08 PM

    > Go’s error handling is more verbose than those other languages, but structurally, there’s a lot of commonality under the surface.

    In Go the type system doesn't force you to check for errors, the same way as languages with null pointers don't force you to check pointers before dereferencing them.

    That's the real problem with errors and null in Go, not the verbosity (though that doesn't help)

  • by tail_exchange on 7/18/23, 4:16 PM

    I was very skeptical of Go, but after trying it, it quickly became my main and favorite language. I think the drawbacks of the language are easily offset by how powerful and simple it is.

    Its biggest flaw imo, which I don't think was mentioned in the article, is that Go did not learn from The Billion Dollar Mistake in Java: null references. You have zero protection against nil pointers, and this is likely not something that can be changed now without breaking backwards compatibility.

  • by synergy20 on 7/18/23, 4:43 PM

    I learned Go on and off in recent years on the side(daily job does not need Go), I like its battery included stdlib and cross platform support.

    I do feel its binary size is large comparing to c and c++, and multiple Go executable can not share libraries as easily as how c/c++ uses the shared lib, when I have a few Go binaries they add up, and I do storage constrained embedded development a lot.

    On the desktop side, I really hope Go can have a GUI in its stdlib, something like what Flutter/Dart does: adding a Skia kind of engine and let me do GUI cross platform, that will make Go main stream like wild fire.

  • by whimsicalism on 7/18/23, 4:06 PM

    Go was successful because it came after decades of pretty much no language putting good networking tools in their stdlib.
  • by Veraticus on 7/18/23, 4:11 PM

    Very insightful. Re: the generics point —

    As a Go programmer I always thought the generics complaint was kind of silly in practice — complicated code should be simplified and made more concrete, not more generic.

    I’m glad generics were implemented, if only to silence the chorus of people who didn’t even use Go but whined about the lack of them. Their inclusion has simplified the stdlib and led to some cool new functions. Nevertheless I think people implementing them in their own projects is basically code smell and they are a symptom of poorly thought-out code rather than excellent code.

    Anyway. This was a good initial post and a good follow-up. Go is my favorite language out there right now for its clarity, power, and ease-of-use. And with loop variable capture coming (the biggest remaining foot gun in the language in my experience) the language is only getting better.

  • by seeknotfind on 7/18/23, 3:39 PM

    Great article. Go may have generics, but because old Go code doesn't, and the standard library doesn't, it still feels like the language doesn't sometimes.
  • by anonyfox on 7/18/23, 6:21 PM

    Comparison with Emacs: an awesome operating system that still needs a great editor.

    Go: amazing tooling/libs, only needs a great language :-)

    But a few tweaks, like proper Enums and a Option/Return Type (to avoid excessive err != nil), maybe a compilerflag to force dealing with errors (instead of _ it) - much better. If I can wish for something, then some native map/filter/reduce to avoid excessive for-loops…? :-)

  • by mrbonner on 7/19/23, 3:17 PM

    Working with Python and Java over the years, I have this feeling that Go isnt battery included. Maybe I miss out 3rd party libraries I am very familiar with? For instance, Python has parse library to help parsing inputs without the need for RegEx. Java has lots of “common” collection libraries. I just feel exhausted coding the same from scratch in Go either because no such library exists or being told just copy and paste!
  • by aptenoforst on 7/18/23, 5:49 PM

    Its a shame that Go as a language is so lacking, the tooling is amazing.

    I wish there was something like Go but with an actually good programming language attached.

  • by worik on 7/18/23, 8:06 PM

    A bit off topic but...

    I need some resources for evangelizing GO.

    I do not use it, but...

    I have a colleague who needs/wants to replace a PHP/Laravel mess. They are talking up Node.js

    I think GO would be a better choice

    This article is close to what I need, but is there anything better?

    The server side code they are looking to replace is handling sensitive financial information and I am very queasy using Node.js in that domain

  • by Alifatisk on 7/19/23, 1:52 PM

    Go is loved because of three reasons.

    - Simple

    - Highly concurrent

    - Impressive networking stdlibs