Earlier quoted context omitted.
It's the number one reason I tried out but wouldn't return and do anything serious in the language. And I'm not the only one.
There are numerous successful "serious" projects written in Go!
Maybe adding generics to Go is about syntax after all
51–60 of 92 posts
Re: Maybe adding generics to Go is about syntax after all
#52Earlier quoted context omitted.
> However quite a few Go developers now use interfaces with an unexported method specifically to stop users from misusing their types in a context they didn't intend. I guess it's come full circle. What a horrible hack. Why bother with that? Either export your interface, your don't.
Well -- what if you have multiple implementations of an interface and you want users to be able to choose between them (or rather, you want them to be able to write functions around your interfaces)? I don't really like it much either, but it's a completely valid usecase for unexported methods. In fact I'm pretty sure this was an example from the language developers for why you can have unexported interface methods i…
Indeed. It's used in the standard library for describing Go's AST if I recall correctly.
Re: Maybe adding generics to Go is about syntax after all
#53Earlier quoted context omitted.
There are numerous successful "serious" projects written in Go!
Of course there are, but I wouldn't want to be the one to write them.
Re: Maybe adding generics to Go is about syntax after all
#54Earlier quoted context omitted.
This is overstating the case for syntax. Without any empirical evidence that syntax is important to anyone other than folks that draft up syntax rules, this is just an assertion. Put another way, do you have evidence that it is important? Has it let people write better programs? How would you prove that? This is akin to saying grammar is important. It is, to an extent; but over adherence to grammar is usually not an…
Well, empirically, syntax is important to a large number of programmers who complain about Lisp's (lack of) syntax. That's not a rigorous empirical study, but it's the best I can do at the moment...
Re: Maybe adding generics to Go is about syntax after all
#55Earlier quoted context omitted.
Yes, the people who want generics are either people who don't use Go, or don't understand the purpose of Go and the implications of adding them to the language.
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{}`.
Re: Maybe adding generics to Go is about syntax after all
#56Earlier quoted context omitted.
Yes, the people who want generics are either people who don't use Go, or don't understand the purpose of Go and the implications of adding them to the language.
Exactly. Say goodbye to fast compiles and easy-to-read code. Not to mention the muddy waters that will result from having both interfaces and generics together.
Re: Maybe adding generics to Go is about syntax after all
#57I was at Gophercon and saw Russ's video where he spent 30 seconds explaining what generics were to the audience and showed a half-baked example of the syntax they are considering. I've been using Go for almost 5 years now and have no desire to see generics introduced. It would ruin what is currently a very simple and easy-to-use language. Am I the only one who is hoping this whole thing fizzles out?
Yes, the people who want generics are either people who don't use Go, or don't understand the purpose of Go and the implications of adding them to the language.
Re: Maybe adding generics to Go is about syntax after all
#58I was at Gophercon and saw Russ's video where he spent 30 seconds explaining what generics were to the audience and showed a half-baked example of the syntax they are considering. I've been using Go for almost 5 years now and have no desire to see generics introduced. It would ruin what is currently a very simple and easy-to-use language. Am I the only one who is hoping this whole thing fizzles out?
Incredible mental gymnastics you've got there.
Re: Maybe adding generics to Go is about syntax after all
#59Re: Maybe adding generics to Go is about syntax after all
#60Earlier quoted context omitted.
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{}`.
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…