3 ms·
Honestly the more I see this the less I like Golang. Generics was the worst thing ever added to the language. We're making it easier for library builders and ha
by akiarie 2mo ago
Honestly the more I see this the less I like Golang. Generics was the worst thing ever added to the language. We're making it easier for library builders and harder for ordinary code to be written.
- woodruffw 2mo agoIs there a categorical division between “library builders” and “ordinary code”? That’s not one I’ve heard before. (I’m aware of the difference between application and library code, but every large codebase I’ve ever worked in is a mixture of both.)
- pstuart 2mo agoI'd say library builders are focused on specific capabilities and doing so as cleanly and efficiently as they can. App builders just want to build stuff and make it work and move on to the next app. Nothing wrong with that but a different mindset and approach.
- pphysch 2mo agoThis proposal is literally about making it easier for ordinary code to be written without defining new generic types or iterators.
- troupo 2mo agoHere's a quick example of ordinary code that is much easier to write with generics: https://news.ycombinator.com/item?id=49128954 https://news.ycombinator.com/item?id=49128954 Working on any collection is easier with generics. Working with anything that accesses data in uniform way (APIs, SQL etc.) is easier with generics.
- jerf 2mo agoDo you use Go? Because it sounds like no. In the last four years I've encountered I think two uses of generics in the wild in a 3rd party library. Both quite sensible. Anyone moaning about how it's ruined Go is either not using Go, or simply impossible to please. If you hate Go... and hey, you do you, I've got my own list of languages I don't like... find a better complaint because this one is simply nonsensical. "It doesn't let me map/filter/reduce" or "it doesn't fix lock problems" or other similar complaints have some grounding in reality, but this one is just absurd. Generics aren't used enough to be "the worst thing ever". Fears about how Go would instantly turn into a language full of generics that take generic arguments that take generic arguments have proved to be wrong.
- Quitschquat 2mo agoThis used to be the popular take not long ago. Now it's grayed out and unpopular.