On 4/9/13 12:54 PM, Peter Alexander wrote:
On Tuesday, 9 April 2013 at 15:50:11 UTC, Andrei Alexandrescu wrote:
Lack of generics makes it very tenuous to do meaningful work on
algorithms and their associated data structures.
Why?
Is this an actual question?
To compound the matter, Go itself doesn't follow its own preaching
(thou shall shun generics and use interfaces throughout) for its own
essential data structures (arrays, associative arrays, and channels) -
all of which are generic in ways unattainable to client code.
Every language has primitives that have special privileges. I don't
think this can be used as an argument against Go.
Of course not. The point here is that it's disingenuous to claim
generics are useless because they're successfully replaced by
interfaces, yet in the same breath use generics for a few select cases.
You can only go this far by claiming two data structures are enough
and algorithms based on map/reduce are unneeded because there are loops.
Two *primitive* data structures. There's nothing stopping you from
creating your own data structures - they just won't be generic like the
built in ones.
This is repeating what I said.
Andrei