Re:Forbes: What is the most valuable programming language to...
by firebrand39 on Tuesday July 15, 2014 @05:25PM
(#8039111)
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
[ Parent
| on HN ]
Re:Forbes: What is the most valuable programming language to...
by coldtea on Tuesday July 15, 2014 @11:18PM
(#8040390)
>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.
Re:Forbes: What is the most valuable programming language to...
by firebrand39 on Wednesday July 16, 2014 @06:46AM
(#8041423)
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.