12 ms·
Why people in Google hate Go?
When you search "golang" on google for a long time, the question "Why people hate Go?" comes up at the top.
Now the blog post "A new way to bring garbage collected programming languages efficiently to WebAssembly" written by the team of V8 (JavaScript and WebAssembly engine) on the official website of Google has appeared.
https://v8.dev/blog/wasm-gc-porting
When I saw in the first paragraph of the blog that "we will get into the technical details of how GC languages such as Java, Kotlin, Dart, Python, and C# can be ported to Wasm" the question "Why people in Google hate Go?" arose
- altun 3y agoRelated: The State of WebAssembly 2023 https://blog.scottlogic.com/2023/10/18/the-state-of-webassembly-2023.html#:~:text=WebAssembly%20is%20still%20most%20often,people%20are%20most%20interested%20in https://blog.scottlogic.com/2023/10/18/the-state-of-webassem....
- Someone 3y agoThey don’t mention go in that list of languages that now can be compiled for the browser because go already has a wasm backend (GOARCH=wasm)
- destevil 3y agoGo isn't a serious language for large systems. The language allows writing shitty code and the community has largely adopted that. Go fanatics will hate this, but you simply can't compare it with the ability to write and maintain in languages like Java.
- gjvc 3y agoI'll bite. Why can't you compare it? Is it the class/function on struct thing? Generics? Go-routines not threads? Rob Pike did say once that the GC is deliberately not tunable because a JVM knob-twiddler should not be a job title.
- za3faran 3y agoMany reasons including: * Poor modeling ability (lack of default interface methods, no records, pattern matching, exhaustiveness checks, etc.). * Error handling is error prone. * Generics are half baked. * No short hand syntax for passing functions as lambdas. * No annotations. * Implicit interfaces make it hard to navigate large code bases because it is very easy to accidentally implement another interface. There are better solutions for the problem they tried to address with structural interfaces. * No string templates. * The GC not being tunable does not obviate the use cases where it needs to be. Furthermore, Java's ZGC only has a couple of knobs anyway, while giving you the option to use a more tunable GC when your use case calls for it. golang's GC is only tuned for latency at the expense of throughput. * goroutines are half baked, see Java's virtual threads + structured concurrency for a more manageable approach. * Observability way superior on the JVM. * No proper enums. * No const/final variable declarations. * Visibility rule are crude. Only public or package private. * Probably more things I didn't think of at this time.
- gjvc 3y agodecent list, to be fair
- guntherhermann 3y agoCan you give an example of 'shitty code'? We've got murmurs of Go being adopted by some teams so if you have first hand experience it'd be really useful
- madeofpalk 3y agoSingle letter variables. A terrible pattern the go community picks up.
- favadi 3y agoSingle letter variables like `i`, `j`? How `index1`, `index2` is any better?
- cultavix 3y agoMy guess is that he means, he would prefer variables to be more descriptive. Easier to read and follow.
- leetrout 3y agoEh. Yes and no. I have not worked on a team that enforces that and I do agree with using them for short functions with 1 or 2 types. I do this in python as well with open(..) as f:
- lm28469 3y agoIs that really the best argument against Go lmao ?
- carb 3y agoI have never seen this done in enterprise Go code, and I don't think it's been strongly recommended since the mid 2010's? For small functions where you can see everything in a single page, this is fine. Though I think they should always be avoided except the most common cases (`i` for index) because keeping a codebase grep-able is a high priority. Using constant, verbose variable names can make tracing through a codebase much easier.
- jjgreen 3y ago
- maze-le 3y agoThis isn't a serious argument, you can write 'shitty code' in Java too. In fact, I've seen more 'shitty' Java than 'shitty' Go, since I've seen far more Java projects than Go projects. It's possible that Go makes it particularly easy, but I somehow doubt that.
- ReflectedImage 3y agoOOP languages like Java are not considered to be good.
- za3faran 3y agoConsidered by whom?
- AnimalMuppet 3y agoBy people who don't like OOP languages. It's an appeal to (pretend) authority by people who won't or can't make a real argument.
- dontlaugh 3y agoJava also has null and overall a weak type system. They're pretty close in that respect, actually.
- pjmlp 3y agoFrom the point of view from Go folks, we need a PhD for mastering Java's type system.
- dontlaugh 3y agoIt has slightly more expressive generics, but otherwise no more complex overall. And no more useful, except perhaps for typed errors. The biggest cause of bugs in Go I find is the weak type system. Nulls, untyped (and overly verbose) errors and the lack of sum types are a big problem.
- pjmlp 3y agoProper enumerations, sum types, pattern matching, exceptions, default interface implementations, dynamic loading, class loaders, annotations, compiler plugins,...
- dontlaugh 3y agoJava sum types and pattern matching are almost impossible to use in practice, sadly. Exceptions aren't a good thing, it's only good that they're typed. Go has exceptions too, they're just used rarely. The rest is not very interesting or particularly complex.
- jjgreen 3y agoGo puzzles me. It's slower than C/C++/Rust and GCed, so not really suited for performance critical stuff. No OO so not really suited for larger complex applications. So for smaller not-performance-critical programs, why not Python, Typescript etc? It seems that its popularity exceeds its scope, or am I missing something?
- dontlaugh 3y agoOOP is generally a bad idea, so lacking it is not a downside. The bigger problem is the weak and inexpressive type system, which is no better for C or Python.
- k__ 3y agoK8s is it's lifeline.
- ecmascript 3y agoI don't use Go since it's from Google but I wouldn't say that Go / Java can't be used for performance critical stuff? There are a lot of values that goes into "performance critical stuff". For me, it can mean a chat app / money transfers etc that is performance critical but is is of course not as critical as in flight software or other system control software where GC could mean deaths.
- jjgreen 3y agoI meant speed-critical by that, sorry if that was unclear. I see opinions like "1/3 the speed of C" bandied around, not bad but means a big model run takes three days rather than one.
- fifilura 3y agoI am not a functional programming fanatic, but I do appreciate all the functional constructs making their way into less esoteric languages. Such as map/reduce and in general working with immutables. Golang does not have this and it makes me feel like programming with only one hand. In particular when working with data and aggregations. I am prepared to be corrected, I have only looked briefly at golang, so I am happy to give golang proponents a chance to shine!
- allyjweir 3y agoI felt very similar when I started working in Go last year. Coming even from languages like Typescript and Python which are most definitely _not_ functional but do have some of the niceties like map/filter/reduce, I was missing it a lot in Go. What I also found was that there was a whole class of errors that I hadn't seen in years due to mutable state and poorly written for loops/ranges when compared to map/filter/reduce usage. We introduced `samber/lo`[1] which provides a lodash-like library, generics compatible, to Go. This has been a big step-up and has improved my experience with writing Go immeasurably. My colleagues now (kindly) joke every time they see a PR from me that includes a lot of samber/lo usage that I'm slowly replacing every for loop I encounter. [1]: https://github.com/samber/lo https://github.com/samber/lo
- fifilura 3y agoThank you! I will probably use it when I run into golang again. I am with you. Ever since working extensively with SQL for a while my go-to paradigm has been "programming without for-loops". It just magically removes the bugs. The problem here, as you also hint, is that there will be a clash with the existing culture and codebase. And that may not be a small thing, even though you co-workers seem to treat you in a good way.
- sebastianconcpt 3y agoWell, putting aside arguments based purely on money, what's the fundamental "edge" that Go gives you as an engineer betting you career long term on it that isn't better used in some alternative?
- izacus 3y ago"Hate"? What do you mean by "hate"?
- boxmein 3y agoGo is an extremely productive language in our experience (large majority of the back-end is in Go). Go excels in tooling and code sharing, and onboarding developers with Go is efficient. It also has an extremely small runtime footprint, reducing ecological footprint and server costs :) An average JVM needs 500+ MB of RAM, whereas our average Go microservice hovers around 25 MB. Last but not least, it is not tied to the existing C ecosystem, which is a HUGE value add in containerized environments where in the majority case you can make a Docker image that is based on `scratch`. Of course there are some quirks (lack of try syntax for example), but Go programs are also simpler to comprehend due to intentional exclusion of AOP, try-catch, etc. Lastly, the interface system is probably the most straight forward and simple for general programming :)
- merb 3y agoYou can actually fine tune to run the jvm at the same memory footprint as go. It’s just not easy to do so. Especially since it lacks structure/value types.
- evilc00kie 3y ago> Last but not least, it is not tied to the existing C ecosystem, which is a HUGE value They also provide their own crypto within the standardlib. No openssl needed.
- SureshG 3y ago>An average JVM needs 500+ MB of RAM We are running small services with heap size under 100 MBs and is absolutely possible with new JVM versions. If you want ever smaller without JIT, native image is also an option. Moreover in most scenarios, JVM provide better peak performance. So here is a tradeoff
- actionfromafar 3y agoWhy people outside Google hate Go?
- favadi 3y ago> When you search "golang" on google for a long time, the question "Why people hate Go?" comes up at the top. I don't see this article in the first page when searching for golang. Maybe the results is personalized based on your search history? > Why people in Google hate Go? I really doubt that. Most developers I know, that worked with Go for a while, love it for its simplicity and tooling.
- andrewstuart 3y agoThere’s still no ideal language. Closest seems something like Zig but it doesn’t seem to be getting much velocity. I really wish TypeScript had an official native code compiler. It did have one but only for microcontrollers and I’m not sure even that still exists.
- Saphyel 3y agoGo was created for an internal promotion of a guy in Google, he already got the promotion I believe, so there's no real use case to keep using it.
- demi56 3y agoYou could say the same for most languages
- gniv 3y ago> When you search "golang" on google for a long time, the question "Why people hate Go?" comes up at the top. What does this mean? Where do you see this? Also, I don't believe that question comes up verbatim, since it's not grammatically correct.
- altun 3y agoPreviously, golang sub reddit came to the top in golang searches. The first title on the subreddit was "Why people hate Go?" was the title. Now go.dev comes first and reddit is below without title. When you search reddit golang, the title continues to come first.
- gniv 3y agoI see. Reddit was the key word.
- nappy-doo 3y agoI worked on Go at Google for a couple of years. First of all, I can't really parse your question, but I'll try to answer what I think you're asking. Go isn't hated at Google – there's just a lot of other code in other languages. C++ and Java are the two most popular, with Python probably rounding out the top three. Go would probably be number 4 (discounting Javascript, because I'm really focused on backend or infra tech). Go's performance is not as good as LLVM derivatives, but that's not what it tries to be. It's a simple language, that tries to be as helpful as possible to the programmer. I describe it as a big-boy python, but think of it as "the C I always wanted." Generally, I don't need the performance of C++. I think lots of people that think they do are probably wrong, but I try to not argue on the internet. If I need to get something done, and get on to the next thing, I use Go. Do I leave cycles on the floor and have (very small) GC pauses – yes, but I get my stuff done, and IMO it's a small price to pay. Use whatever language helps you get your stuff done. Stop arguing over languages. -- Having said that, if the question is, "why aren't the WebAssembly people mentioning Go?" I don't know. Go's supported WASM for a long-time, and the people inside Google who care about WASM care about Go. There is new stuff in WASM not really taken advantage of in Go, but Go is also a strange animal with a strange stack model, and it takes time. I would think, as with all things Go, it'll be there, but it will take a little time, be thorough, complete, well thought out, and maintained roughly forever.
- altun 3y agoThere is a tragicomic story that I think is related to this question. Quote from Ian Lance Taylor (Google Principal Engineer) "Now a bit of personal history. The Go project was started, by Rob, Robert, and Ken, as a bottom-up project. I joined the project some 9 months later, on my own initiative, against my manager's preference. There was no mandate or suggestion from Google management or executives that Google should develop a programming language. For many years, including well after the open source release, I doubt any Google executives had more than a vague awareness of the existence of Go (I recall a time when Google's SVP of Engineering saw some of us in the cafeteria and congratulated us on a release; this was surprising since we hadn't released anything recently, and it soon came up that he thought we were working on the Dart language, not the Go language.)" https://groups.google.com/g/golang-nuts/c/6dKNSN0M_kg/m/EUzcym2FBAAJ https://groups.google.com/g/golang-nuts/c/6dKNSN0M_kg/m/EUzc...
- Luker88 3y agoIMHO the hate comes from golang looking more like a better python than a better C. Onboarding of new people is extremely fast, but lack of features will result in seniors hitting a wall on what they can do and guarantee with the language. While go tooling great, you still have to test for most of the edge cases that C and python have: nullpointers, lack of proper enums/typesafety. This is commonly reflected in the tests that have to check for lots of trivial things. Rust is much more difficult to learn, but the amount of things you need to test is drastically reduced, and seniors appreciate that. What we see in our company is that juniors will find go wonderful, seniors dream of switching to Rust. The hate probably comes from high expectations (especially coming from python/C), followed by hitting a feature wall due to how opinionated (and slow to adopt new features) golang is.
- elp 3y agoGo is a lot closer in target market to Python than C and I can take a mostly competent python programmer and get them to a mostly competent Go programmer fairly quickly. Rust is all very wonderful but it's too hard for juniors to become productive in any reasonable time frame. Go might be type unsafe compared to Rust but its staggeringly more type safe than any of the interpreted languages. Then you also have about the same speed of Java with instant startups and no memory bloat as a general purpose backed language its great. I would sell my first born to get the ? operator for error handling that Rust has though. The "if err!= nil" stuff bugs the hell out of me.
- belter 3y ago"Why people hate Go?" - https://www.reddit.com/r/golang/comments/mjhf5h/why_people_hate_go/ https://www.reddit.com/r/golang/comments/mjhf5h/why_people_h...
- usrbinbash 3y ago> When you search "golang" on google for a long time, the question "Why people hate Go?" comes up at the top. I just did. Here are my top10 results: https://go.dev/ https://go.dev/ https://en.wikipedia.org/wiki/Go_(programming_language) https://en.wikipedia.org/wiki/Go_(programming_language) https://github.com/golang/go https://github.com/golang/go https://de.wikipedia.org/wiki/Go_(Programmiersprache) https://de.wikipedia.org/wiki/Go_(Programmiersprache) https://gobyexample.com/ https://gobyexample.com/ https://twitter.com/golang https://twitter.com/golang https://github.com/golang https://github.com/golang https://www.geeksforgeeks.org/go-programming-language-introduction/ https://www.geeksforgeeks.org/go-programming-language-introd... https://www.geeksforgeeks.org/go-programming-language-introduction/ https://www.geeksforgeeks.org/go-programming-language-introd... https://www.freecodecamp.org/news/what-is-go-programming-language/ https://www.freecodecamp.org/news/what-is-go-programming-lan... This continues down for dozens of results. Articles, Frameworks, Tutorials, Projects.
- altun 3y agoYou are right. But until last weekend, it continued to appear. It currently does not appear in queries made within Germany.
- thiht 3y agoThere are the languages people shit on, and the languages nobody use. Go is far from perfect, but I’m productive with it, it’s expressive enough that it’s both easy to write AND read, it’s performant enough, easy to build and deploy, and most importantly, it gets shit done. I don’t need more, but the Go team still delivers great updates every 6 months or so.
- demi56 3y ago[dead]
- ksec 3y agoI dont think people in Google hate Go. But I have heard multiple times people in Google hate Ruby.
- ChrisArchitect 3y agoAsk HN:
- edimoldovan 3y agoIt has a richest std lib with quite good performance which makes it suitable for a lot of use cases where one wants to reduce dependency. I also find it quite easy to learn. Personally use for all web products I build as I have gotten the hang of it and have a small sort of framework to build products quickly with. And I get to ship a single binary to production.
- pushingice 3y agoWhen I was there the only complaint I heard was the golang exceptions to the style guide. In no other language would you be allowed to name a variable a single letter like "r" for example.