Why Generics?
21–30 of 261 posts
Re: Why Generics?
#22Personally, I prefer the current interfaces-based solution to generics. It's a little verbose, but keeps the language simple. However, I think that the people we should be listening most are the ones developing huge projects in Go, like Kubernetes. Would having generics with this new contracts thing make it easier to develop and maintain e.g. Kubernetes? I'm truly curious.
I think idiomatic golang works pretty well without generics in most cases, the big problem for me is that functional programming is essentially impossible without them.
Re: Why Generics?
#23Go 3: Why HKT? Go 4: Why homoiconicity? Go 5: Why uniqueness and borrowing?
Re: Why Generics?
#24Re: Why Generics?
#25Go 3: Why HKT? Go 4: Why homoiconicity? Go 5: Why uniqueness and borrowing?
What is HKT?
Re: Why Generics?
#26Personally, I prefer the current interfaces-based solution to generics. It's a little verbose, but keeps the language simple. However, I think that the people we should be listening most are the ones developing huge projects in Go, like Kubernetes. Would having generics with this new contracts thing make it easier to develop and maintain e.g. Kubernetes? I'm truly curious.
Re: Why Generics?
#27Earlier quoted context omitted.
I have yet to find one practical application for generics in the apps I've built in Go.
Every project I’ve written so far in golang could benefit from generics.
Its lack of impact is why I dont really care about the subject. Adding or removing generics to a project matters little. So why bother complaining. The class creation and encapsulation choices are much more impactful to future code edits.
Re: Why Generics?
#28Re: Why Generics?
#29Personally, I prefer the current interfaces-based solution to generics. It's a little verbose, but keeps the language simple. However, I think that the people we should be listening most are the ones developing huge projects in Go, like Kubernetes. Would having generics with this new contracts thing make it easier to develop and maintain e.g. Kubernetes? I'm truly curious.
Many smaller projects would benefit too. I would like to build a typesafe tree for an efficient sorted map, and to be able mergsort over multiple trees of different types. It would allow some extremely useful channel combinators for doing rather common things like safely shutting down a service with some background processing. Often these things leak and a often I find myself spawning more go routines just to map between types or to stop generic interface types infecting the rest of the API.
Re: Why Generics?
#30why are people obsessed with simplicity? there's a quotation my Einstein that I like to keep in mind: "make things as simple as they can be but no simpler". the implication being that if you make things too simple then you actually break things. lack of generics makes for software that's actually more complex than it needs to be. Take for example Swift: lots of complex features (protocols, all manner of functional tr…
Why are we not using C++ where Go is currently being used? By your logic, this shouldn’t be the case.