That's true of course. But templates (and even worse, operator
overloading - uuggghh!) make it that much easier to write poorly
designed code, and to write code which is difficult to understand.
Even if the original design is ok, when someone else comes along and
has to fix something in code using templates.
This is an area where I think the distinction between C++ templates and
Java generics is important to understand. Java generics don't allow
anything *new* to be done, it just allows existing or future Java code
that employes the "generic idiom" (essentially using Object, or often
some base interface to write code that operating independent of type)
to carrying on doing exactly that same thing, only with greater static
type safety.
If a particular piece of Java code was bad or good design before
generics, it remains bad or good after. I do speculate however that
many uses of the generic idiom which *are* bad design will provide
difficult to parameterize for enhanced static type checking, and that
this in fact could be used as a "smell" for flushing out such bad
design in code.
-wilhelm
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden