Re: Static vs. Dynamic typing (big advantage or not)

From: Gerry Quinn (gerryq_at_DELETETHISindigo.ie)
Date: 07/11/04


Date: Sun, 11 Jul 2004 09:54:19 +0100

In article <18xHc.16$yN1.13@newsread1.mlpsca01.us.to.verio.net>,
newsgroup@brising.com says...
> > I'm not addressing your main point, but the specific case of the new generics
> > (and covariant returns) in Java 1.5 is relevant.
>
> Generics in Java are an apology for having collections of Objects,
> and are somewhat like the puritan's suspicion
> that someone, somewhere, might be enjoying themselves.

More of a fix - or attempted fix - for the stupid casting that is
needed.

C++ templates may not be easy to write in the first place, but they sure
are great to use:

Basket< Cat > catBasket;
catBasket.add( cat1 );
catBasket.add( cat2 );
Cat cat = catBasket.take_one();

No need for a cast! No possibility of accidentally adding dogs!

- Gerry Quinn