> Just some facts related to the generics discussion:
>
> - When Java added generics (2004), people started to look for another
> languages:
> - Ruby on Rails hype started around 2005.
> - Groovy started on 2004.
> - Scala started on 2004.
Generics were added to Java around 1998, not in 2004. Scala creator
Martin Odersky was part of the design team for generic Java.
Oracle's version of Java for mobile devices still lacks generics. I
don't think that increases its popularity among programmers.
Go is quite distinct from Java, Javascript, and C++, and lessons from
those programming languages do not necessarily carry over.
- When Java added generics (2004), people started to look for another
languages:
- Ruby on Rails hype started around 2005.
- Groovy started on 2004.
- Scala started on 2004.
- After writing the best-seller Modern C++ Design book, Andrei
Alexandrescu got involved in the D programming language development.
Which among other things, tried to simplify C++ templates.
These are only facts. Now anyone can have it's own conclusions.
It's need not be "little", and it need not be "huge", and it also
gives an extra bunch of expressive behaviour.
> I don't think so
> Generics make programmers think in "is-a" relationships,
Really?
> while "has-a"
> would much simpler and easier to reason about.
> I'm using C just fine, and I never see a particular need for
> generics.
I've used C just fine, and a bunch of code I needed to write was
hand-coded generics for the Usual Suspects: sequences, finite
maps, etc.
--
Chris "allusive" Dollin
that said, I suppose we could get away w/o generics but using
interface{} (or special interfaces like sort.Interface) and still
recover some performances with a JIT (to de-virtualize calls), but
that's another can of worms :)
-s
I would rather live without generics unless it can be a really good implementation.