On Tuesday, June 21, 2016 at 10:29:37 AM UTC-4, Henry wrote: > You still haven't provided any argument why generics is indispensable.
That can't be the litmus for language feature inclusion; if it was, Go would resemble ASM. In my personal experience, something North of 50% of my non-trivial applications could have been more simple with some form of generics allowing me to reduce code duplication. In particular, any application dealing with demarshaling of data from a large set of similar functions (e.g. web calls) are good examples. Have 30 functions to make the same web calls and perform the same demarshaling calls -- especially where the web call may be more complex, as in a SOAP call -- does not make the code cleaner, easier to cognitively parse, or more safe. Indeed, in almost every such case, generics reduce code duplication and make the code safer from bugs, and easier to maintain. Indispensable? That's subjective, and very few language features satisfy that requirement. For me, the strongest argument against it is that if the core Go team can't think of a way to implement it cleanly and efficiently, then I trust it's a hard problem. I'm sure they've looked at it; it must be the single most commonly requested, hashed-over, and proposal-backed feature. --- SER -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.