logoalt Hacker News

CamouflagedKiwitoday at 1:41 PM3 repliesview on HN

They didn't say they never wanted to do generics, but that they did want to take their time and do them right.

Debatable how much they have been "right", although this gets them somewhat closer. And I think they have not been "wrong" in the ways they wanted to avoid (they referenced some issues with Java generics as prior art, although I forget the details).


Replies

thaynetoday at 5:51 PM

Depends you who "they" is. If you mean the go development team, then yes, they said they wanted to "take their time and do them right"¹. But there are many "gophers" who did say that there was no need for generics, and that it shouldn't be added to the language.

¹ I would argue that it is really, really hard to add generics to a language after it has already matured, and still "do it right" than to add it in the beginning. At least if you care about backwards compatibility. Backwards compatibility adds a lot of constraints to your generics system that will almost certainly lead to a sub-optimal design. And you will be stuck with a standard library, and a lot of existing ecosystem code that would benefit from generics, but don't because generics didn't exist when they were written. This is a lesson I wish go had learned from Java's generics.

tinestoday at 3:22 PM

From another commenter here:

> The post quotes the Go FAQ as saying, "we do not anticipate that Go will ever add generic methods".

show 2 replies
someone_19today at 4:30 PM

I agree that they were clearly not in a hurry. I disagree that they are doing everything right. I am interested to see how they will fix the 'million dollars mistake'.