|
|
|
|
|
by cogman10
1652 days ago
|
|
> Do you think Generics will be an overall win for the Go language, or will they be overused / end up making code harder to read / harder reason about? Here's my $0.02 from a java background. There will be cases where someone overuses generics. That happen pretty much every time a new language feature lands in any language. However, my expectation is that like java, you will see Go generics in general practice only come up when dealing with things like collections. Once the community settles and stops trying to use generics as a meta-programming language, they will become pretty boring (which is what you want). From a readability standpoint, IMO, generics in Java don't really have a negative impact on readability. Sure, you'll get the random `Map<Map<String, Object>, Object>`... but most people see that as the anti-pattern it is. In short, I'm guessing they'll be a win. |
|
It's that "correct by accident" part that's hard to have both safe and performant without generics.