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

C doesn't have generics. Objective-C didn't get generics until 2015, which is well after Go was released. Not all major static languages have generics and not all major static languages had generics when Go was being planned.

Not that Go ever planned to not have generics. It was always simply a question of how to implement them in a non-ridiculous way. They were warned early on by members of the Java team to tread carefully and not make the same mistakes they did.

The team has crafted many generics proposals over the years, but they all fell short one way or another.



C has basic support for generics since 2011.

Objective-C merges C's type system with the dynamism of Smalltalk. Generics are only meant as a mechanism to ease interop with Swift.

Dynamic languages naturally don't require generics due to their semantics.

The team always handwaved the remarks of many of us as they now themselves recognise.

"In retrospect, we were biased too much by experience with C++ without concepts and Java generics. We would have been well-served to spend more time with CLU and C++ concepts earlier."




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

Search: