3 ms·
> Generics I was concerned by this at first as well, but after using Go full time for the past two years, I've never found a need/use for them. Go doesn't lean
by wyattjoh 10y ago
> Generics
I was concerned by this at first as well, but after using Go full time for the past two years, I've never found a need/use for them. Go doesn't lean towards strict OO principles, where I feel that most of the Generics uses are applied (Arrays, sorting, etc.).
Not everyone's opinion, just my two cents.
- the_duke 10y agoYou only have "generic" functionality for built in types though. Arrays. (In a certain way maps and channels). That's fine if you only use those, but it makes it impossible to write generic functions for much else. See my comment about lack of libraries. I did miss them a lot. Not when writing your one off app or program, but for libraries. And you end up having to implement a lot yourself that's for free in other languages.
- zzzcpan 10y agoPromises and some other higher-order programming without generics are not really usable in Go.
- omginternets 10y agoWhy would you need, or indeed want promises in Go? Doesn't a channel/channel-select fulfill this requirement? EDIT: the answer seems to be downvote. Okay.
- the_duke 10y agoI guess you are being downvoted because the comments above have nothing to do with promises.