+1 IMO the place generics would be useful is reducing the use of the empty interface and then a type switch. Otherwise I don't see quite what people are doing that wouldn't be better done with interfaces. In the past I mistakenly tried to declare local methods on the builtin types. Revisiting my ignorance I wonder if that would help though.
I see the logic that "append and len and other inbuilt functions are generic and idiomatic, so it would be better to allow others to write their own generic functions". However I would argue that the problem could be turned on its head. It's not that other types need to be made more like the inbuilts, but that inbuilts become more like all other types. Why doesn't append have an interface requirement like the sort interface? Anyway I realise I don't understand the problem enough to wrap this up in an official proposal, but I see it as it is things like channel operations and arithmetic that are unusual and should use interfaces (under the hood), rather than everything else fitted around them. But this is probably me not understanding the problem that people are trying to solve. It's more than people wanting to neither use an empty interface, nor declare their interfaces isn't it? Chris On Monday, 17 September 2018 17:04:26 UTC+1, jucie....@zanthus.com.br wrote: > > Go core team is working hard to bring generics to the language because > several people asked for it. With all due respect for those users and for > people working hard to make generics a reality, I feel that a greater > number of people would suffer after generics adoption. So, I feel compeled > to manifest my opinion: sorry guys, Go with generics will be worse than Go > without generics. > > The language strives for simplicity since its inception and that is what > attracted a large part of its user base. We must think about who we will > want to have in our community 10 years from now. Supporting generics would > please a minority to the detriment of a large number of potential users. > > Today Go is easy to learn and tools are easy to implement. Please keep it > that way. > > Thanks. > -- 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.