5 ms·
Gotta admit, that really is a cute example. However, I was a bit surprised when the author described Go as "unacceptably crippled." What is he referring to?
by gautamcgoel 7y ago
Gotta admit, that really is a cute example. However, I was a bit surprised when the author described Go as "unacceptably crippled." What is he referring to?
- saagarjha 7y agoLack of a decent type system?
- augusto2112 7y agoProbably lack of generics?
- gautamcgoel 7y agoI wonder if the author would have a more positive impression of Go 2, which is planned to ship with generics...
- Filligree 7y agoSlightly less crippled. One can keep the performance and feature comparisons going for a while. Go shouldn't be Rust. We already have Rust. Though while I say that, I'd still hate to have to use Go.
- TheDong 7y agoThe usual suspects for things missing from go are the following: Generics, sum types, match statements, tuple types, compile-time data-race detection, type-safe concurrent-maps, hygienic macros, immutable types/references, functional constructs such as 'map', 'filter', or monads, marker interfaces, better error handling, type-inference for consts that isn't garbage, etc. Less common complaints are that it's missing: object oriented features like inheritance, a configurable gc (as java has), the ability to work with OS threads, c-compatible stacks for fast c-interop, ownership semantics, type-inference for arguments (e.g. as haskell does), operator overloading, dependent types, etc. The list of things in the first set can mostly be summed up as "go has a worse type-system than C++/rust/etc, something much closer to java 1 before generics, or c". Basically, the language is intentionally crippled because it intentionally ignores advances in type-theory that have been shown to allow expressing many things more safely. For example, sum types and match statements make modifying code much safer. People will write switch/if-else-ladder code to do exactly the same sort of thing even without them, the code will just fail at runtime rather than compile-time when a new variant is added or one is not handled by accident.
- baby 7y agoSum types and match would be a clear win for Golang imo, the rest I’m not so sure.
- tsimionescu 7y agoFrom the first list, adding generics would essentially automatically also give you type-safe concurrent maps and map/filter/zip/etc.
- nicoburns 7y agoGo code feels very low-level to me, and very boilerplatey. In Rust I can write code that in almost the same way I write JavaScript (but with added type annotations), but Go makes me deal with all the little details, and makes it hard to abstract things neatly. Lack of generics is a big part of the issue. But more generally the focus on "simple" code means that more sophisticated abstractions are actively eschewed, and personally I find this makes writing Go code quite frustrating.
- The_rationalist 7y agoYour comment is weird. The one making you deal with the little details should be rust, e.g go is garbage collected. Secondly, javascript + type annotations is typescript.
- Gaelan 7y agoDisclaimer: I’ve never tried to write Go. Memory management is not the only type of “little detail.” For instance, rust provides common collection operations (filer, map, find…) in the standard library. In go (AFIAK), you need to hand-write a loop for each. IMO, the rust version is takes much less mental bandwidth to write and understand.
- The_rationalist 7y agorust provides common collection operations (filer, map, find…) Those are just standard functional methods available in most languages. Go indeed is noteworthy for it's lack of features.
- Gaelan 7y agoYes, of course. I just described it as a Rust feature because that was the comparison being made in the thread.
- deleted 7y ago[deleted]
- hu3 7y agoInteresting how developer views can differ. Someone describes Go as "unacceptably crippled" while Uber engineering has 1500 microservices written in Go, making it their primary language. https://news.ycombinator.com/item?id=21226347 https://news.ycombinator.com/item?id=21226347
- gnuvince 7y agoPopularity ≠ Quality.
- mav3rick 7y agoThese are orthogonal points. Linux Kernel is all in C and possibly drives the world. Doesn't mean it's safe and amazing.
- hu3 7y agoC was the only sensible choice back then. Uber on the other hand has many languages available yet picked Go. So they certainly don't think it is "unacceptably crippled".
- mav3rick 7y agoMany teams just start with what they know and then that sets the tone. It no way means that the language is better. Amazon uses Java. Does that mean it's better than Go ? Popularity paints an incomplete picture at best.
- hu3 7y agoExcept that Uber started with JavaScript and Python. Switching to Go was an educated decision. Not a continuation of what was there. https://www.quora.com/What-is-the-technology-stack-behind-Uber https://www.quora.com/What-is-the-technology-stack-behind-Ub...
- jakear 7y agoThere is an implicit "for my use-case" following "unacceptably crippled". So, go is not "unacceptably crippled" for the use case of creating a ton of small, simple, easily maintainable services at Uber, but it might be "unacceptably crippled" for the use case of having fun with type systems, or whatever the author was interested in at the time they were considering go as an option.
- jnericks 7y agoIts a shallow view of the language and shows how egotistic he probably is.
- c3534l 7y agoGo is simple to the point where it annoys a lot of programmers, especially programmers who like to do fancy stuff with their programming language (the kind of person that's attracted to Rust, for instance).
- baby 7y agoI’m mostly working with Rust, and I really like it, and I can even understand why WRITING Golang can be frustrating at times, but it should be clear to everyone that Golang is the best language to READ.
- dtn 7y ago> it should be clear to everyone that Golang is the best language to READ I often see Go functions with a large number of lines- many of which are noisy boilerplate error handling. Combine that with terse variable names, type inference and it's straight up tiresome to filter out the important parts. These functions aren't even doing all that much. There is a healthy middle-ground between excessive abstraction a la Enterprise Java and what Go offers.
- kissgyorgy 7y agoGod no. Python is the best language to read! Go is too verbose.
- tsimionescu 7y agoI completely disagree, coming from a Java and C# background. There are nice aspects to reading Go, but any function which does some kind of error-prone operation is so hard to grok, it gets tiring - the actual purpose is constantly interrupted by 'if err := nil' so much. And gods help you if there is some actual non-trivial error handling going on, as you've generally learned to gloss over and can easily miss that one place that actually does something with an error other than log and return. Also, while admittedly rare, trying to review code that needs to copy structs around, if they also involve pointers or slices, is just hell.
- 7y ago