5 ms·
Could someone explain why is Go so hyped? In my personal opinion it is just not a good language, and I think many judge it based on some false basis that it is
by kaba0 3y ago
Could someone explain why is Go so hyped?
In my personal opinion it is just not a good language, and I think many judge it based on some false basis that it is somehow “close to the hardware” because it produces a binary. Like, the amount of time it is put next to Rust when the two have almost nothing in common..
It is very verbose, yet Java is the one that is called that, often by Gophers, which is much more concise. It has terrible expressivity, a managed language which is a perfectly fine design choice, yet seemingly every other language with a GC is somehow living in sin.
And still, it doesn’t fail to show up each day on HN.
- SmooL 3y ago1. It's opinionated, so there's often only one way of doings things. Largely, the "one way" is a good way, so people appreciate the forced consistency 2. It's simple. It is very easy to read and write. It is hard to shoot yourself in the foot. 3. It's powerful. They have a few core abstractions that compose well (generic io, http stuff). 4. It's fast. It runs fast because it's compiled, and it compiles fast because it's simple. Me personally: I appreciate the simplicity of it. It's a great language for working with in a team. I wish it was more functional, and had better ways to handle errors, but the simplicity of it all was a breath of fresh air using it in a working environment.
- mirekrusin 3y agoYou can shoot yourself in the foot with null pointers.
- konart 3y agoYou can find a gun to shoot yourself in the foot in any language.
- saghm 3y ago> It is hard to shoot yourself in the foot. >> You can find a gun to shoot yourself in the foot in any language. Sure, but finding that one isn't particularly hard, which is what GP was responding to
- mirekrusin 3y agoWell, it's million dollar one though. It has been solved in many languages. It gives quite uneasy feeling that high percentage of your LoCs can be potentially affected, it doesn't come from some contrived edge case code, it's everywhere.
- andrewjf 3y agoI feel like a lot, if not all, has to do with the Google backing. Back when Go was announced, the company had _a lot_ of goodwill, and were envied by anyone doing software engineering. So, pretty much anything they did had an immediate following and base of engineers willing to blindly adopt whatever they did.
- philosopher1234 3y agoI don’t buy it. I can’t think of a single other Google backed programming language with anywhere near to the following of Go. I think Googles stamp gives it some legitimacy, but I think the much likelier explanation is that the values in Go and its design speak to frustrations a lot of people actually have. This thread is full of people arguing in favor of gos error handling. You can dismiss them all as cranks or sheep if you want, but I think that would be misunderstanding something.
- andrewjf 3y agoI mean, maybe - but there's a lot of examples of things being as popular as they are because google did them - gRPC, Protobuf, Kubernetes, Chromium. None of these things were technically bankrupt (including Go), but their adoption curve would not have been what they have been without Googles name on it. There's likely other OSS that's technically better, but did not have the network effects google-backed software had from day 1.
- philosopher1234 3y agoGo almost certainly would not have been as successful Without googles brand. But also, without its funding. Google has poured tens of millions of dollars in to go. all of the good qualities of go are due to its incredible funding, whether that’s tooling or the fact that three or four extremely experienced engineers were given years of time to design and implement it.
- aatd86 3y agoYes but also think about it? In 2012 and even now, which language would you use to replace Go. Assuredly not C++, nor Rust... No javascript, swift has become more complex apparently, not haskell... Not C... OCaml? No it has a weird syntax, French people and wanting to be different... Etc... So no, Go has genuinely appreciable qualities that are not found anywhere else :o)
- philosopher1234 3y agoI think this claim is too reductionistic to go anywhere. There is no single thing that can explain go’s success. There are hundreds of small differences in the language (and tooling, which arguably is more important). Most people are not going to care enough (or have the time) to enumerate every single difference between go and Java, and why they prefer the trade off go makes. I use Java professionally, and go where I can, and there is a lot I prefer about go (I won’t pretend it’s uniformly better, though.) And fwiw, me and you have gone back and forth about this question in many threads previously. I think asking it from such a high level is not going to very effectively get into the details that actually matter to people. Finally, I also think a lot of what makes go preferable is not in the realm of language design (at least not the algebraic type theory kind) or specific features. It’s much squishier than that, and involves feelings about how teams work and what developers do in practice (and why they fail).
- kaba0 3y agoThen let me ask instead: why does Go hit the HN front page each day? I would say Rust used to be/is similarly hyped, but it is sort of understandable there, as it is built on a novel idea and fits a previously unoccupied space. This is not true of Go, and we could just as well see just as many D, Java, C#, Haskell, OCaml posts, yet they combined are not as frequent “visitors”.
- philosopher1234 3y agoI think there is something that advocates/users of Go see in it that they don't feel has been understood by its detractors. And on the flip side, I think the detractors are not very interested in understanding what is good about Go, instead it seems more like a nuisance to be swatted away. I think this creates a great deal of tension between the two, and leads to massive blowup threads. So long as issues (like error handling) persist where these groups cant understand each other, i think the same arguments will repeat.
- kaba0 3y agoThanks, you are likely correct.
- kinghajj 3y agohttps://en.wikipedia.org/wiki/Worse_is_better https://en.wikipedia.org/wiki/Worse_is_better Go is a language made by Googlers, so its design helps with Google problems. And many of Google's problems are ones of scale. * Go is straightforward to read. Any reasonably-competent college graduate should have little trouble understanding it and be able to become productive quickly. * Go compiles into completely static binaries. You don't have issues like "oops, the build system runs CentOS 7 but we're deploying it to Ubuntu 18.04 and their libc's aren't compatible." With containers, you can copy many Go programs into `FROM scratch` images and they will work fine, greatly reducing the attack surface area. I used to dislike for Go for similar reasons to you and others, but after using it for a few years at $employer, I've come to appreciate its merits. Sure, it can be a bit annoying to write if err != nil { return err } again and again at first, but I just type 3yy7jp to yank+paste it as needed. You could also configure some editors to detect when you type `if err` and generate it automatically. It's also not uncommon for editors to fold the lines down into a single line.
- za3faran 3y agoYet, the bulk of code written at Google remains Java and C++. golang's approach to uncolored async was decent, yet in the same manner of the language, overly verbose and error prone. Passing channels everywhere gets tricky quickly, and you have to manually ensure that contexts and deadlines are handled everywhere. Errors in golang do not have stack traces, and wrapping errors is just an error prone way of manually (and apparently nonperformant way of) generating stack traces.
- stephen123 3y ago"completely static" has a gotcha though. I was getting segfaults yesterday because libc was removed from my docker image. I had to add `CGO_ENABLED=0`
- bombolo 3y ago> Go compiles into completely static binaries * sometimes. It can also dynamically link stuff on occasions, depending what options you use.
- konart 3y agoIn my personal opinion it's a great language to solve problems _I_ have to deal with in course of my work. Can I solve them with Java? Sure. Difference is go does not have the complexity you can find in Java and quite opinionated. So you don't have to spend as much time working with the language inself and can focus on getting the job done. Go is not as expressive and some other languages and does not have the same abstractions that make other languages more suited to be used while developing comlex software. Thing is - in many cases you simple do not need any of it, but need a fast verbose language with good tooling. Call it Java Light or something.
- za3faran 3y agoCould you elaborate on exactly what complexity in Java you're referring to? By having an overly simplistic language, you end up pushing more complexity onto the programmer and into the code base. There is no free lunch. I find it much more sane to solve and express code in Java. You get terser, more to the point code that reflects the underlying logic more clearly, compared to having to read many lines or pages to understand what's going on.
- konart 3y ago>By having an overly simplistic language, you end up pushing more complexity onto the programmer and into the code base. There is no free lunch. Sure, I just don't see this as a problem. As a result you have a) a number of third party packages to chose from depending on your needs\opinions b) you have a more verbose codebase, some people find it harder to deal witih while I find it easier to deal with. >compared to having to read many lines or pages to understand what's going on. Different people different ways of thinking I guess. In my eyes Java code looks to much like a specification in for of a code. Easier to do a code review but harder to actually understand how it works. And I personally need this dive into internals to actually feel confident about the code. >Could you elaborate on exactly what complexity in Java you're referring to? I don't have too much experience in Java, but from what I've seen - Java has too many abstractions and OOP for the sake of paradigm and nothing else. UPD: adezxc's comment is a good addition to mine
- 3y ago
- w7 3y agoIt has: * Relatively simple syntax. * "Good enough" expressivity-- nothing that's considered "missing" has been a true blocker for most projects. * An easily accessible concurrency primitive, with the bonus that the runtime can choose to execute goroutines in parallel (when able)-- this comes with no required function coloring or split in a code base. * A well opinionated environment packaged with the compiler: default formatter, default method for fetching remote deps, default documentation generator, default race detector, default profiler, default testing system. * Decent portability-- can cross compile relatively easily from one platform to another, doesn't require a larger runtime pre-installed on the foreign host. * "Batteries included" standard library. * Inertia-- enough of an active community to pull what you need from the Internet, whether it's guides or code. * A "good enough" type system to catch some errors before they become runtime errors. * A "good enough" abstraction for operating on data with: structs, interfaces, and methods. With composition being preferred over inheritance, and embedding bringing handy sugar. No language is perfect, everyone has an opinion, but for many people this is "close enough" to what they prefer to work with. Gophers may just be a bit more vocal about it.
- za3faran 3y agoI'm strongly convinced that the google brand name gave it a big push. Its predecessor (Limbo if I recall correctly) went nowhere. It did bring uncolored async to the mainstream, but as in typical golang fashion, it was very verbose and error prone. Java learned the right lessons and I'm quite excited to see their structured concurrency approach. No need to pass channels and contexts everywhere to manually manage hierarchies from what I gather.
- stephen123 3y agoYea, I find go's concurrency very error prone compared to something with futures. I've even got a library for using futures in Go. https://stephenn.com/2022/05/simplifying-go-concurrency-with-future/ https://stephenn.com/2022/05/simplifying-go-concurrency-with...
- throwawaymaths 3y ago> It did bring uncolored async to the mainstream I believe that uncolored async (Erlang) precedes colored async (python) Correction: c# was the first language with colored aaync, still way after Erlang
- hknmtt 3y agoGo is hyped because it's amazing to work with. It's clean, simple, readable, very powerful and fast, has goroutines and a ton of libraries which are very easy to get,
- mtzet 3y agoI agree that go and rust have different areas, but that was less clear when they were getting started. Back then go was trying to figure out what it meant by 'systems programming language' and rust had a similar threading model. Another point is that they do share similarities, which might we might now just describe as being 'modern': They're generally procedual -- you organize your code into modules (not classes) with structs and functions, they generally like static linking, type inference for greater ergonomics, the compiler includes the build system and a packager manager, there's a good formatter. The above are points for both rust and go compared to C/C++, Python, Java, etc. So why do I like go? I think mostly it's that it makes some strong engineering trade-offs, trying to get 80% for 20% of the price. That manifests itself in a number of ways. It's not the fastest language, but neither is it slow. I really dislike exceptions because there's no documentation for how a function can fail. For this reason I prefer go style errors, which are an improvement on the C error story. Yes it has warts, but it's 80% good enough. It's a simple language with batteries included. You can generally follow the direction set and be happy. It leads itself to simple, getting-things-done kind of code, rather than being over-abstracted. Being simple also makes for great compile times.
- kaba0 3y ago> I agree that go and rust have different areas, but that was less clear when they were getting started That I agree with. But Go is anything but modern on a language front. It shares almost nothing with Rust, which actually has a modern type system (from ML/Haskell). Even if we disagree about exceptions (I do like them as they do the correct thing most of the time, while they don’t mask errors, but include a proper stacktrace), go’s error handling is just catastrophic, being an update from c which is even worse is not a positive.
- mtzet 3y agoI'm not arguying that go has modern tech, but rather that it has modern sensibilities. This means not trying to force 90s style OOP, preferring static linking for easier deployment, including a build system and package manager with the compiler and preferring static types with type inference to dynamic types. This differentiates go, rust, zig, odin etc., from languages like C++, Java, C#, Python etc. I think it makes sense to describe that difference as one of modern sensibilities.
- jhoechtl 3y ago> Could someone explain why is Go so hyped? You can write huge code bases with it, the tooling is good. You can use a moderately skilled work force to achieve good results. When some team members leave, you are not left with some wizardry code base behind.
- bheadmaster 3y ago> Could someone explain why is Go so hyped? For me, it's: 1) channels (and goroutines, of course) 2) explicit error handling (panics are actually fatal, in contrast to exceptions which are often even used for flow control) 3) easy (cross-)compilation - just go build And probably a few more reasons I can't remember at the moment. It's just fun to write Go!
- nbraxf100 3y agoI'm not a fan of the syntax either. My impression is that "close to the hardware" is not the selling point, but "close to Unix" is. If you view the language as a safer super shell script, it becomes more obvious. Go was hyped in the beginning, but I get the impression that now it isn't. The most persistently hyped language here is Python. Fortunately, we see more Elixir, Ruby and Go posts lately.