Re:Maybe adding generics to Go is about syntax after all
by stouset on Tuesday September 04, 2018 @01:45PM
(#17911100)
Great way here to completely discount the criticisms of people who've used the language and found it unacceptable how often you have to escape out of the type system of a "safe" language with `interface{}`.
[ Parent
| on HN ]
Re:Maybe adding generics to Go is about syntax after all
by ilovecaching on Tuesday September 04, 2018 @02:26PM
(#17911521)
I've written Go for three years, and I've successfully avoided using interface{}. It's a matter of architecting your application to fit the language and choosing a different language if your requirements grow beyond what Go can provide. Golang has made a tradeoff between simplicity and abstraction, which is a perfectly fine choice. Turning Go into Java is just going to ruin yet another language with complexity thanks to mob mentality.
Re:Maybe adding generics to Go is about syntax after all
by laumars on Tuesday September 04, 2018 @03:29PM
(#17912058)
It's not always that simple. Sometimes you cannot avoid using interface{}. There is a reason why some SQL libraries use interface{}, why (un)marshallers use interface{}, and why I use it heavily in my scripting interpreter which is written in Go.