4 ms·
I must write code that is just too simple and uninteresting because I never use generics. I also really enjoy go.
by 4ydx 12y ago
I must write code that is just too simple and uninteresting because I never use generics. I also really enjoy go.
- notduncansmith 12y agoHave you ever used Array#map in Javascript (or any dynamic language)? What about filter or reduce? Those are useful things not possible in Go. Well, technically they are (whipped up a quick example): http://play.golang.org/p/e2qkKN4VY1 http://play.golang.org/p/e2qkKN4VY1 But it requires the use of interface{}, which reduces the usefulness of the type system, and you still can't do (what I guess must be crazy) stuff like return a slice.