4 ms·
They resisted generics since day 1 on the basis of pragmatism. Now they included them on the basis of pragmatism? I remember something similar with their appro
by pydry 5y ago
They resisted generics since day 1 on the basis of pragmatism. Now they included them on the basis of pragmatism?
I remember something similar with their approach to package management which they said wasnt necessary for years.
They really do seem to resist doing the right thing for as long as possible.
- neilalexander 5y agoIs it really that much of a bad thing to iterate based on real world experience?
- deleted 5y ago[deleted]
- maleldil 5y agoIt is when they spend a decade insisting that they right and everyone else was wrong, then ended up doing it anyway. Generics aren't a cutting edge feature that they wanted to see how it would develop. Their objection against it was ideological.
- neilalexander 5y agoI don't really understand this type of criticism. People complained that Go didn't have generics, and now that they've delivered, people still want to complain for some reason. I can quite believe that the Go team wanted to be sure that the approach made sense for Go, that it was the right solution to the right problem and to keep to their backward compatibility promise. Experience is a good teacher. I really don't know why it matters in the slightest that they didn't arrive at that on day one.
- philosopher1234 5y agoWhy are you so bitter about it?
- foldr 5y ago>they spend a decade insisting that they right and everyone else was wrong This just isn't how it happened. The Go team never said that they were opposed to generics. Their stance was (i) that it was not a top priority and (ii) that it was difficult problem and they'd take the time to implement generics correctly. The idea that this is about one group of people finally proving that they're 'right' is a distortion based on viewing events though the lens of snarky comments on the internet.
- hbn 5y agoI believe I watched a talk from Rob Pike a few years ago where he mentioned that Go didn't have generics, not because they didn't want generics, but because they wanted a Go-like way of doing them, and wanted to spend a lot of time making sure they were done right. I'm paraphrasing and I wish I had a source for you but I'm pretty confident I didn't make that up.
- pydry 5y agoThe FAQ said something similar - not that they were vehemently opposed, just that it wasnt a priority.
- kortex 5y agoThey never resisted generics as a concept. But they refused to implement generics in a way which compromised other Go values. Compilation speed was a big one. It's easier to implement generics if you sacrifice compilation speed (see: c++, rust, and iirc java). To their credit, it took the community a looong time to figure out how pull that off, because it's a hard problem. But I think they've done it.
- esprehn 5y agoFWIW Java doesn't sacrifice compiler speed for generics, they're entirely erased at compile time which is cheap. What they sacrificed was runtime correctness, because the type erasure lets you sneak invalid types into unsuspecting code. How much of a problem that's caused in the real world is debatable.
- adamrt 5y agoIt’s not like they just had them ready to go at the flip of a switch and we’re just holding out. There were trade offs and they didn’t have a solution on day one. They’ve always said they were open to them with the right implementation.
- sacado2 5y agoThey 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.
- mseepgood 5y agoNo, they didn't.
- _j_jonas_2231 5y agoThe Go team takes their time to thoroughly consider and conceptualize new features. That is a often forgotten virtue.