News for hackers. Stuff that matters.
Re:Why I like Golang's interfaces by camus2 on Thursday April 13, 2017 @01:05PM (#14108836)
> that doesn't work in many languages,

it does when the language has generics. You in fact wouldn't need 2 types []fooint and []Fooer but a single List<T Fooer> , as long as fooint implements Fooer.

So with Go you end up writing functions that convert types manually. The 1000's time you do this, it starts getting a bit tiresome.

Re:Why I like Golang's interfaces by zellyn on Thursday April 13, 2017 @01:14PM (#14108933)
Well, Java has generics, but you still can't do this same thing: http://stackoverflow.com/questions/1115230/casting-object-ar...

I agree that having generics in Go would be fantastic, and I'm excited at rsc's articulation of why. But they don't completely solve this problem.

Re:Why I like Golang's interfaces by camus2 on Thursday April 13, 2017 @01:20PM (#14109004)
But with Java the point is that you'd approach the issue differently without being overly verbose just like Go. I mean my example is clear. You wouldn't have to cast anything provided you use generics at first place.