foobar:

> 1. D templates are an enhanced version of C++ templates which are 
> a poor design. The problem stems IMO not from issues with OOP but 
> rather with the horrible idea of C++-like templates. Other 
> languages have *much* better solutions which integrate better.

C++ is one of the most commonly used languages, probably there are billions of 
lines of C++ in use, and C++ library code uses templates often, so despite the 
well known flaws of C++ templates (bloat, bad error messages, etc), they are 
somehow "good enough", they aren't horrible.

Compared to C++, D templates introduce constraints, a better syntax, and more 
uniform/sane semantics of details. Bjarne Stroustrup is still trying to invent 
simplified Concepts to improve C++ templates, to give them "static" types.

Java generics, C# generics, Ada generic programming, C++ templates, ML 
polymorphism, Haskell type inference with type classes, Haskell template 
extensions, are designed to satisfy different needs and constraints. All of 
them are used and useful, none of them are perfect.

Bye,
bearophile

Reply via email to