4 ms·
They weren't ever firmly opposed to generics. Here's the FAQ from 2009: https://web.archive.org/web/20091113154906/http://golang.org/doc/go_lang_faq.html https
by sacado2 5y ago
They weren't ever firmly opposed to generics. Here's the FAQ from 2009:
https://web.archive.org/web/20091113154906/http://golang.org/doc/go_lang_faq.html https://web.archive.org/web/20091113154906/http://golang.org...
> Generics may well be added at some point. We don't feel an urgency for them, although we understand some programmers do.
> Generics are convenient but they come at a cost in complexity in the type system and run-time. We haven't yet found a design that gives value proportionate to the complexity, although we continue to think about it.
12 years later, here they are.
- FlyingSnake 5y agoJava was created in 1995 and got generics in JDK 1.5 in 2004, I don't see anyone using this argument against Java. The weird fixation people have about Golang generics is really tiresome, that too after they have added generics after much deliberation.
- pjmlp 5y agoIn 1995, Standard ML, Ada and Eiffel had generics and were hardly mainstream, C++ templates were still experimental, everything else did not used them. A tad different from the computing world in 2009.
- jerf 5y agoHaving watched this for a while, I would say, my fellow programmers, there's no need to build elaborate psychological defenses for why you don't want to use a language. Just don't use it. There's too many languages to know them all anyhow. You don't have to decide not to use something, then justify your decision with a few comfort blankets that you post every time the topic comes up. Just don't use it, and leave it at that. Or at the very least, skip posting your comfort blankets every time the topic comes up. There's a dozen languages I'd like to know better, and don't use them, and I don't run around giving myself "reasons" I don't learn them. The "reason" is simple: I don't have time. Languages are not an attack on you. Nobody who designed a language was even thinking about you when they created them. I speak here to those who slag on Go and haven't so much as run "Hello World" in it. Those who have used it, especially for some period of time, and especially those who tried long enough to learn to program Go-in-Go (as opposed to Rust-in-Go or C++-in-Go, etc.), and decided they didn't like it due to their experience, I invite to continue discussing. You're not who I'm talking about here. Real experiences with the language are valuable contributions. Those who haven't had real experiences are not making valuable contributions. "Lol generics, lol they realized they're wrong and I was right all along" and "Lol error handling is bad in Go" are not valuable contributions.
- kwertyoowiyop 5y agoAnd of course this opinion is getting downvoted! :-)
- FlyingSnake 5y agoThis here is the right sentiment, thanks for saying this. I would not bother the internet if my preferred feature is not present in Zig/Nim/Elixir.
- corn_dog 5y agoYou don't think it contributed at least a little to Go eventually adding generics?
- jerf 5y agoNo, I don't think the whining did a thing. It may seem impressive on HN, but compared to the continuous stream of whining any successful project receives about all sorts of things I suspect it was weighing less heavily on their mind than HN would think, because it's proportionally much smaller than HN thinks. Also, it's not like Go isn't already fairly successful; if I wrote a language as successful as Go I wouldn't exactly be crying myself to sleep every night, you know? Cruise through the Go issues and look at all the closed issues. Then, for context, cruise through Rust's or Python's, or your favorite open source project of some size that isn't even a programming language. It's a constant deluge. What did it was real use cases from using the language for a long time, offered by serious people who weren't just berating the designers. If you read the generics design, and especially if you read the whole history of the design, you can see where this has had an impact, where the features are tuned for the use cases presented by the community, and how the design has changed at least twice in a major way (depending on how you count, of course) as people work through the use cases. You'll also come to understand better why it's not like you can just flip a switch and "turn on generics" and why everyone running around claiming it was easy is dead wrong. You can also learn some of this by paying attention to discussions of generics in other languages when Go is not a topic, because it'll become clear when not discussing Go, there's a lot of broken generics and strange edge cases and poor decisions made by existing languages that we have to live with forever. Not that all of them are broken, but, again, the idea that some care needs to be taken wasn't something the Go team just made up. There's plenty of languages, even big name languages like Java, that "flipped the switch and turned on generics" and it turned out not to be as awesome as presented, because it's a legitimately hard problem even in 2021.
- masklinn 5y ago> Java was created in 1995 and got generics in JDK 1.5 in 2004, I don't see anyone using this argument against Java. Java was created in an age where very few languages with mainstream relevance had userland generics. Go was not, and generics had already had to get (somewhat painfully) retrofitted in two of the above.
- DylanSp 5y agoYeah, this. In 1995, about the only mainstream language with generics was C++ with templates. (Same in 2000 when C# was released, incidentally) When Go came out in 2009, though, Java and C# had pushed generics into the mainstream. Additionally, they'd shown some of the problems with trying to retrofit generics onto a language and ecosystem that didn't previously support them.