[TriLUG] C# and .NET

Brian Weaver weave at oculan.com
Mon Jul 1 17:05:46 EDT 2002


On Mon, 2002-07-01 at 15:56, Tanner Lovelace wrote:
> The STL and templates are the best thing since sliced bread. :-)
> BTW, if anyone here hasn't read Bjarne Stroustrup's paper about
> teaching C++ versus teaching C, I highly recommend it.
> (http://www.research.att.com/~bs/new_learning.pdf).
> 
> Ed, I have seen a version of Java generics from a few years
> ago.  The one I saw compiled to standard java and then used
> the normal java tools (compiler, jvm, etc..) from there.
> I remember thinking it was a good step forward (gaining
> true generic strong typing) and wondered why it wasn't in
> the language to begin with.  I had heard it was going into
> 1.4, but I guess that got pushed back.  I think it's 
> actually a bit ironic that, at least in one way, Java is
> becoming more like C++. :-)
> 

Tanner,

For C++ the STL (and its required language feature Templates) is
probably one of the best things to happen to C++. However, Java Generics
would be a step in the wrong direction for Java. If you look at many of
the issues that the STL addresses in C++: container (list, dequeue, map,
etc al), algorithms (sort, find, etc), and functors (less, greater,
equal_to, etc) most, if not all of the corresponding features have been
implemented in Java with its generic classes and "interfaces."

Interfaces provide something very similar to templates, but it more than
just that since it is a method contract for implementing objects. Adding
Java Generics to the language would just add more kruft that really
isn't necessary (or very useful for Java IMHO).

BTW: Don't put any signs in you cube advocating Java Generics.... I'm
fairly sure your co-workers will lynch you ;-)

Weave





More information about the TriLUG mailing list