Comment by __s
1 year ago
Generics can be a bit of an eye sore, but go already had reflection & I recently was mucking around bigquery's internals full of `reflect` having to read through that, & it doesn't even get backed by a type checker
`func Index(s interface{}, v interface{}) int` both has to deal with incompatible types, & the function body is going to be anything but simple
(sure, without generics most people wouldn't even write that `func Index`, but ultimately there's plenty of libraries deep in reflect that'd greatly benefit from generics)
I've also been dealing with temporal.io using interface{} everywhere, got to a point where I wrote typed wrappers using generics to have type checking for signals
No comments yet
Contribute on Hacker News ↗