3 ms·
I find it curious that the vocal parts of the Go community touted the lack of generics as a feature for so long, and that the language would be worse with them.
by mort96 5y ago
I find it curious that the vocal parts of the Go community touted the lack of generics as a feature for so long, and that the language would be worse with them. It's nice that Go now does have the tools necessary to make usable, high-performance datastructures, but it's a bit frustrating to watch the apparent complete 180° flip from the community when the pro-generics parts were so vocally shouted down for so long.
I feel like so often, online discussions about these things become wars between the "X is the best thing ever and all the things you think are faults are actually features" camp and the "X is the worst thing ever because it lacks [single critical feature]" camp.
- nemo1618 5y agoLike many things, it's a spectator sport. Most people just parroted the opinions of the Go team -- which isn't a bad strategy, given how smart they are! Don't worry, the anti-generics crowd is still here, waiting to see how things shake out. It will take years before we can confidently assess the impact of generics on the language and ecosystem.
- jitl 5y agoA community is not a single person.
- avl999 5y agoA lot of it is cargo-culting based on comments of the go-team members and applying the advice of go team members as a blanket as opposed to applying it more surgically in the context of your application. For example I used to get a lot of pushback from the go community when using an assertion library, for those not familiar, go's testing library doesn't have support for asserts so you end up writing a lot of code like if want != got { t.Fatalf(....) } this gets esp annoying as you deal with more complex objects. Many in the go community criticize using an assertion library to write simple assertions as in other languages for your tests, citing that the go team members are against casually bringing dependencies in your project. Not realizing the intent Go Team's "statement against dependencies" is a targeted word of caution urging people to think about the dependencies they bring into their project rather than a blanket attitude against dependencies. Almost certainly Go Team would not advise against bringing in a build time time dependency that is not even gonna be part of the binary you ship that will make your tests easier to write and error messages consistent.
- dilyevsky 5y ago> I find it curious that the vocal parts of the Go community touted the lack of generics as a feature for so long Citation needed. Afaik the actual reason was general lack of understanding how to effectively implement it within constraints of Go’s philosophy
- barakm 5y agoYour last paragraph is exactly right. Contrary to your first statement though, there’s very little turnabout in the Go community and your Go-hating child posts fit into the two camps you mention at the end. We wanted it too, even feeling hamstrung! I’m an old Gopher and I’ve spent a lot of my career in C++ and, now, Rust, so it’s not like I don’t understand generics. But I’ve also seen the space-cadet architectures that come out of overuse thereof. (Rust has a latent version of this, what with Arc<Mutex<T>> being the only way to get things done, come at me). A common argument from the peanut gallery is that Go folks hate generics. No. I just hate the overly meta use thereof. I’ve long wanted an honest generic in Go for a few container types. This shows up as a desperate need, eh, maybe twice a sizeable project (and in a different way each time!). And I hate working around it but I do. So it’s disingenuous at best to say Go folks don’t understand generics or are buying a party line thereof. We know it well, and know the nightmares it can lead to. So maybe appreciate some caution in giving the mice a cookie? This isn’t the first iteration of this war, even. Another thing Go eschewed (that I rarely hear argued) is classes and, particularly, subclasses! Yet, every so often (including a recent project) that would be a really useful paradigm. But OOP is not “in vogue” and so that’s not one of the BS battlegrounds. Point is, all languages have pros and cons and there’s no one right way. To quote a famous film, “Life is pain. Anyone who says otherwise is selling something” :)
- deleted 5y ago[deleted]
- azth 5y ago> Another thing Go eschewed (that I rarely hear argued) is classes structs and functions on them are basically classes. golang lacks subclasses as you point out, otherwise everything is the same.
- DeathArrow 5y ago>But I’ve also seen the space-cadet architectures that come out of overuse thereof. What concrete problems caused by the use of generics have you encountered? Do you see those problems coming to Go, as it now has generics, too? Go seems to me a very verbose language and the addition of generics might improve things a bit in this direction.