Go has contempt for generics

Jonathan M Davis jmdavisProg at gmail.com
Fri May 28 19:06:35 PDT 2010

bearophile wrote:

> Andrei Alexandrescu:
>> That has Java 1994 written all over it.
> Java today can be the most used language, so despite its faults, probably
> it was good enough. Even if Go has no templates, it has plenty of time to
> add them five years from now :-) (And in the end templates aren't the only
> way to design a type-generic language).
> Bye,
> bearophile

I'd argue that Java suffers from the fact that they added generics late in 
the game. Generics by erasure brings no benefits except backwards 
compatability, and they cause a whole host of problems for people trying to 
use them. Yes, you _can_ add things like generics into the language later, 
but it can be quite disruptive to do so, and the result could be subpar due 
to constraints such as backwards compatability.

Sure, you _can_ use a language without generics (and many other features) 
and get a lot done, but I'd argue having simplicity as your prime directive 
tends to lead to an inefficient tool for the programmer. Simplicity should 
be a goal, but there are times that it should be overridden by other goals.

- Jonathan M Davis

More information about the Digitalmars-d mailing list