Re:Seven years of Go
by mappu on Thursday November 10, 2016 @03:42PM
(#12924139)
Generics in java work via type erasure, so <T> is the same as interface{} by the time the code is running.
[ Parent
| on HN ]
Absolutely not, they are not the same. Without generics, the compiler can't make any guarantees on the soundness of your code. Go will accept code that's inherently broken and that Java will simply refuse to compile. I like to catch such errors as soon as possible.
As for saying "they are the same once the code is running", well, duh, of course, but it's completely useless by then.
Re:Seven years of Go
by magnushiie on Thursday November 10, 2016 @04:47PM
(#12924727)
Although I very much like C# where generics are not elided, I think most of the value comes from the productivity from static analysis, and therefore Java generics cature most of the value. Perf improvement opportunities are great though.