4 ms·
> I like generics for collections but that is about it. What about algorithms (sorts, folds, etc) on those containers? I write a lot of numerical code. It su
by xscott 6y ago
> I like generics for collections but that is about it.
What about algorithms (sorts, folds, etc) on those containers? I write a lot of numerical code. It sucks to do multiple maintenance for functions that work on arrays of floats, doubles, complex floats, and complex doubles. Templates/Generics are a huge win for me here. Some functions work nicely on integer types too.
- marcus_holmes 6y agoI think this is probably the single best use case for Generics for Go - numerical operations on the range of number types.