Re:Go Is on a Trajectory to Become the Next Enterprise Progr...
by ilovecaching on Thursday May 09, 2019 @03:36PM
(#19871502)
As a Go developer, I rarely ever miss generics. If you design up front with interfaces and the lack of generics in mind, you can almost always avoid needing them.
[ Parent
| on HN ]
Re:Go Is on a Trajectory to Become the Next Enterprise Progr...
by networkimprov on Thursday May 09, 2019 @03:55PM
(#19871729)
And when you finally get them, you'll wonder how you ever lived without :-)
Re:Go Is on a Trajectory to Become the Next Enterprise Progr...
by mcdee on Thursday May 09, 2019 @04:25PM
(#19872051)
Yet having moved from (primarily) Java to (primarily) Go I find I don't miss them.
Re:Go Is on a Trajectory to Become the Next Enterprise Progr...
by Insanity on Thursday May 09, 2019 @04:25PM
(#19872052)
I had them (Java and C#) and I am happy Go does not have them. I feel like most people just miss them for collections and abuse them in other instances.
And for collections Go has other tools (like generator if you really want to). Overall in the 2ish years of writing Go, I only missed them when I was learning the language coming from years of Java.
Re:Go Is on a Trajectory to Become the Next Enterprise Progr...
by erik_seaberg on Thursday May 09, 2019 @10:10PM
(#19874472)
When you need to switch from native maps to sync.Map, you not only have to give up type safety but rewrite all your calling code. Codegen doesn't help because you are not one of the people allowed to overload those operators.
Re:Go Is on a Trajectory to Become the Next Enterprise Progr...
by bakul on Thursday May 09, 2019 @04:52PM
(#19872306)
It is more that you code around the lack of generics.
Interfaces: same API, different source code. Generics: different APIs, same source code.
This is why Go needs to have generics.
Re:Go Is on a Trajectory to Become the Next Enterprise Progr...
by bobbylarrybobby on Thursday May 09, 2019 @04:27PM
(#19872071)
A bit like saying if you know you won’t have a hammer, you’ll instead bring a drill, a screwdriver, and screws. But sometimes it’s nice to be able to nail things together.