4 ms·
Java and C++ programmers seem to like generics (templates in C++'s). Both languages needed to make some compromises, like Java's run-time type erasure and the c
by todd8 9y ago
Java and C++ programmers seem to like generics (templates in C++'s). Both languages needed to make some compromises, like Java's run-time type erasure and the complexity of the C++ templates with the resulting compile times.
I'd like user defined collections to be easier in go, but that's only one reason I'd like generics in go. I'd also like to remove one of the biggest arguing points over the programming language go, a language I think hits lots of important requirements. Getting it adopted by more teams will be easier and the whole go ecosystem will expand more rapidly if there was less to argue over.
I believe the go team when they say they haven't solved all the problems with adding generics to go; however, worse is better and Java and C++ show that an approach to generics doesn't have to be perfect to be very beneficial.
- caseymarquis 9y agoC# generics don't have either of those issues, though there's no C# wildcard type, which means annoying workarounds through inheritance when you want a list of wildcard generics.
- sjellis 9y ago"I'd also like to remove one of the biggest arguing points over the programming language go, a language I think hits lots of important requirements. Getting it adopted by more teams will be easier and the whole go ecosystem will expand more rapidly if there was less to argue over." That's how I feel about it. I have a suspicion that this will play out like classes in ES6: some people use them a lot, some don't, some feel that that they should not be used, but it was necessary to add them to the language for the community to move forward.