News for hackers. Stuff that matters.
Re:Go generics may use square brackets [] not parenthesis () by coldtea on Tuesday July 14, 2020 @10:53PM (#23840689)
>I wish they would just freeze the language and not add anything. I like it the way it is.

And a big share of users wishes they add generics - judging from it being the #1 voted feature in the annual Golang polls.

Not to mention the potential users that are put off because it doesn't have Generics...

Re:Go generics may use square brackets [] not parenthesis () by lostmsu on Tuesday July 14, 2020 @11:59PM (#23841178)
Once they add generics, I will stop laughing at the language, but still probably won't use it. There's very little if anything it adds over C# or modern Java.
Re:Go generics may use square brackets [] not parenthesis () by pjmlp on Wednesday July 15, 2020 @02:24AM (#23841977)
Until Docker or Kubernetes fad doesn't go away, having to deal with Go is something that those of us that rather use C# or modern Java have to face, so it will help if the language catches up with modern times.
Re:Go generics may use square brackets [] not parenthesis () by pas on Wednesday July 15, 2020 @04:54AM (#23842777)
But those large codebases will not be updated for some time. Or do you mean that at least new features could be written using generics?
Re:Go generics may use square brackets [] not parenthesis () by pjmlp on Wednesday July 15, 2020 @05:40AM (#23843036)
The latter, as I always mention, platform languages always have the edge even if not as fancy as guest languages.

In the context of Docker and k8s, Go is the platform language so to speak, and although there are extension points for other languages, one has less integration headaches when using Go as well.

Re:Go generics may use square brackets [] not parenthesis () by geodel on Wednesday July 15, 2020 @12:30AM (#23841317)
True. I think really a lot of people who are clamoring for generics in Go would already be working with more productive languages.

Generics is mainly for users who have committed to Go and new productive language features could possibly help them.

Re:Go generics may use square brackets [] not parenthesis () by coldtea on Wednesday July 15, 2020 @01:25AM (#23841663)
On the other hand, programmers don't always pick which languages they get to work with.

If I'm forced to use a language, it might as well have Generics than not...

Re:Go generics may use square brackets [] not parenthesis () by lkramer on Wednesday July 15, 2020 @06:18AM (#23843278)
At the moment it has something very valuable those languages don't have: A lack of Generics. Once they add Generics it will just be competing with those languages on the same turf.

It might not be for you, you may rely heavily on Generics in your daily work flow.

If I need generics in my work, I reach for Rust or C++. But when I want to write an easily maintainable microservice that's not trying to reinvent the wheel or need some clever datastructure to handle the work, I reach for Go, since that is what it's good at (at the moment).

Re:Go generics may use square brackets [] not parenthesis () by rightbyte on Wednesday July 15, 2020 @06:59AM (#23843544)
How is having generics/templates to reinvent the wheel?

The one thing that put me off the most about using C for everything is lack of a common list/vector/map/set standard library for all types. Instead I reinvent the wheel in each project. Go cheats in this regard with compiler magic and that just pisses me off. Atleast you can in theory do printf in iso C.

Re:Go generics may use square brackets [] not parenthesis () by chartpath on Wednesday July 15, 2020 @10:06AM (#23845384)
How is being compiled the same turf as running in a VM?