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

> so we didn't have to hear about it anymore

Generics were a mistake, and this is spot on.



Go always had generics, map, slice, chan are all generic. Go just didn't let the user write any generics, so fuck you if you want any other data structure until 1.18.

If you really think you don't need generics, take your code code and replace every

  []int{}, []string{}, map[string]string{}
with

  []interface{}{}, map[interface{}]interface{}{}
and see how much you "don't need generics"


Almost 40% of respondents either use generics or want to use generics, after having been released 6 months ago in 1.18. That's… a pretty incredible adoption rate for something that I've repeatedly heard wasn't necessary or was a mistake.




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

Search: