Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This summary concisely captures the key thing about generics that has kept them out of Go for so long: they weren't created in a vacuum. Go's developers had the flaws in C++ and Java's approaches to draw on in their attempt to find a better approach. Many people calling for generics to have been implemented sooner were fine with those flaws in the other languages, but the Go team wanted to do better than that.


Generics exist in languages since 1976, more than enough examples than focusing on C++ and Java.


good point! What could the Go team glean from those languages to improve Go's generics implementation?


Lots of things, here is their acknowledgement that it was a mistake to ignore them.

> we were biased too much by experience with C++ without concepts and Java generics.

https://go.googlesource.com/proposal/+/master/design/go2draf...


If they wanted to avoid problems they would have implemented the feature right away, instead of making it a second thought for a supposedly modern language.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: