Hacker News new | ask | show | jobs
by firebrand39 4355 days ago
That's probably more a matter of taste. Go has a reflect package which allows the programmer to determine type at runtime, making generics unnecessary. It may not be as convenient and familiar as generics. Here is an example http://play.golang.org/p/a18VESulWS
1 comments

>That's probably more a matter of taste. Go has a reflect package which allows the programmer to determine type at runtime, making generics unnecessary.

That's not "making generics unnecessary". That's "using an ugly hack that throws typesafety away instead of a proper solution".

And it's more familiar than generics, that's what Java had before they understood that they had to have generics.

Well, you are right it reminded me of method overloading. Otherwise I think time will tell. In the end generics are just types with parameters, for creating typed permutations _at_compile_time_ of functions/maps etc.. And as you said, java worked quite a while without them.