James Kanze
10/1/2008 7:53:00 PM
On Oct 1, 2:58 pm, puzzlecracker <ironsel2...@gmail.com> wrote:
> > That is a real question. About the only answer I can give
> > is that I think that the vendors don't care about the
> > standard (or their users).
> Unless, templates won't gain a wide acceptance, there is no
> reason not to implement them. Usually more useful features
> packed in the compiler, translates into $$$$
> > Two major differences. First, generics in Java (and I
> > suppose C#---I don't know the language) are several orders
> > of magnitude simpler than templates in C++. (And a lot less
> > powerful.) Second, neither language has a standard, and both
> > have a "primary provider", who more or less "standardizes"
> > what he wants, or in other words, what is easy for him to
> > implement.
> Wouldn't be better if standardization committee was
> affiliated, if not fully responsible, for the implementation,
> much like with C# and Java?
Yes. It would be great. Get a fully conformant compiler for
free.
The problem is: who's going to pay for it? In the case of Java
or C#, one company pays, because they control the specification,
in their interest, not in yours. In the case of C++, it's an
official international standard, and anyone can participate.
There are some real users on the committee, and several
different, competing implementors, so it doesn't end up working
for just one large company.
> > > Yes, in C++ they are implemented differently, yet not
> > > better.
> > They are specified differently, not just implemented
> > differently. As for better... C++ templates are
> > significantly more powerful than the templates in other
> > languages, and that does cause implementors problems.
> I agree, they're more powerful in essence, yet most its power
> has yet to come to compiler vendors.
Are you kidding? All of the power (e.g. export) isn't always
there, but many of the techniques not available in Java are
implemented in just about every compiler. (Well, at least the
ones available to me: g++, Sun CC and VC++.)
> At my current employer (as well as previous) we don't have any
> code using templates; though this is not a representative
> sample set.
I'll say. I think I qualify as one of the most conservative
users in production code, but I (and every company I've worked
for) started using templates close to ten years ago.
(Experimental implementations were available over twenty years
ago.)
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34