News for hackers. Stuff that matters.
Re:Generics aren't ready for Go by apta on Monday February 18, 2019 @11:44AM (#19191942)
Keep in mind that many golang programmers just parrot what the golang authors say, without fully understanding it or even realizing the golang authors are wrong (not saying that's the case in this specific instance).

They hear the golang authors complain about Java, that it's the only way to do things, so they think that the only other solution is to go the extreme opposite way, not even looking at real modern languages (which golang isn't) like Kotlin or even C# for instance.

It's very evident that the golang authors have no experience designing language, and didn't look in depth at what other languages did.

Re:Generics aren't ready for Go by throwaway415415 on Monday February 18, 2019 @01:41PM (#19193017)
Unfortunately I am not parroting. If you are used to read code, and you read c++, you will see that templates are abused. No generics force devs to make their code clearer and thus more secure.

It is evident that Go is a better language than most thanks to the creators having deep experience in that domain.

Re:Generics aren't ready for Go by je42 on Monday February 18, 2019 @10:47PM (#19196436)
for sure i can abuse Go's language features as well in unintended ways.

Language abuse happens when the feature is the only available feature to implemented a particular and no other language feature allows for a better implementation.

in C++ most abuses of template are related to the missing feature "concepts". which took quite a while to get their.

If language switching is not an option, and your application requires generics and you are also required to use Go, you do have a problem. You need abuse the language and work around re-implement generics for Go.

Which can result in a very ugly development process, difficult to maintain code etc.

Re:Generics aren't ready for Go by latronic_notron on Monday February 18, 2019 @01:47PM (#19193095)
They aren't abused in C#, Java, Haskell, OCaml and other languages. Honestly, picking C++ as an example of traditional generic usage is a bit disingenuous.
Re:Generics aren't ready for Go by Gibbon1 on Monday February 18, 2019 @02:20PM (#19193415)
I think generics in C# are really well executed and solve a lot of problems in C#'s problem domain.

I do think you're on the right track that go's designers are pushing back hard on what they see as feature abuse in C++ and Java. C++ abuses templates and has dozens of ways to do anything that also don't interact with each other well. Java abuses inheritance, abstractions, and OOP.

go uses generics under the hood, probably the designers fear that generic's will also get abused if released into the wild. On the other hand I've never heard anyone bitch about well designed generics in other languages. Which is a tell since people will bitch about anything and everything.

Re:Generics aren't ready for Go by latronic_notron on Monday February 18, 2019 @02:24PM (#19193462)
> I do think you're on the right track that go's designers are pushing back hard on what they see as feature abuse in C++ and Java

Now that you mention it, I can't really blame them!

> On the other hand I've never heard anyone bitch about well designed generics in other languages. Which is a tell since people will bitch about anything and everything.

That's my opinion as well. Generics are quite pleasant, simple and a great tool to have when they're well designed.

Re:Generics aren't ready for Go by spion on Monday February 18, 2019 @02:14PM (#19193363)
I would suggest a Go programmer give ReasonML an honest try (as an example language where "generics" are done right), but the getting started / documentation situation is still not at Golang level so thats a bit annoying.

Maybe F# would be a better choice. .NET Core and its tooling are pretty well done. C# and NET Core would be another nice alternative.

Re:Generics aren't ready for Go by latronic_notron on Monday February 18, 2019 @02:25PM (#19193480)
Agreed. I find C# and F# surprisingly refreshing. ReasonML is a bit unfinished, but it's a sign of great things to come.
Re:Generics aren't ready for Go by apta on Monday February 18, 2019 @03:58PM (#19194376)
golang authors seem to only have experience with C++ as they keep talking about C++'s deficiencies, as if it's the only other language that exists when it comes to generics.
Re:Generics aren't ready for Go by throwaway415415 on Monday February 18, 2019 @04:49PM (#19194791)
Sure. Seems like they have the same experience than me then.
Re:Generics aren't ready for Go by apta on Tuesday February 19, 2019 @12:40PM (#19200930)
The point is that they are not familiar with the solutions other languages have. So it's either the C++ way or don't look elsewhere.