5 ms·
Arguing that generics are in "the basics" is a little disingenuous, don't you think? Go has been wildly successful without generics, and the designers of the la
by shakezula 5y ago
Arguing that generics are in "the basics" is a little disingenuous, don't you think? Go has been wildly successful without generics, and the designers of the language were quite intentional and opinionated in leaving them out.
- pjmlp 5y agoThe basics appeared into the scene via CLI and ML in 1976/78. Plenty of time. There were also plenty of successful languages without generics in the last century, that doesn't mean we should keep designing them.
- xh-dude 5y agoWhat frustrates me a bit about this argument is that interfaces really do offer a tool to solve problems around dispatch and polymorphism. Like a lot of things in Go there are lots of opinions and tradeoffs that can’t or can’t easily be revisited by someone using the language, but it’s a very different argument to say “I don’t like the tools the language provides” than “the language doesn’t provide x, y, z”. IMHO there are convincing arguments that Go needs x, y, z (or: prefer another language if you need x, y, z). A good example of one of these that is being addressed would be priority queues. Doing them via interfaces was always possible - there’s a whole std lib package for them. Generics will be better. But looking at the pre-/post-generic ways of doing priority queues confirms and emphasizes, rather than negates, the utility of interfaces as a way of structuring code. It’s still opinionated and I think it’s fair to argue about alternatives but it’s absolutely not the case that some large class of reasonable problems was entirely ignored or forgotten.
- pjmlp 5y agoJava pre-1.5, or Oberon derived languages, Objective-C pre-generics, C++ARM, we oldies know how it was.
- shakow 5y ago> Arguing that generics are in "the basics" is a little disingenuous, don't you think? Not really. Type polymorphism exists since the 70's, it still blows my mind that people consider that they are ‶too hard to understand for developers″, or that ‶their implementation is not very clear to language designers″. > Go has been wildly successful without generics JS have been wildly successful despite its many fundamental flaws, success is not an indicator of intrinsic quality.