Am 19.10.2010 13:29, schrieb bearophile:
Some of the problems of C++ templates:
- The syntax is a big problem; if you want to use them to do complex things you 
need to write lot of ugly code. The lack of basic constructs like static if 
doesn't help at all.
- The semantics is not clean, there are several corner cases, that turn 
template programming into a puzzle solving activity.
- C++ templates are a functional language, but the C++ compilers usually lacks 
the normal tools a functional language needs, like a garbage collector and an 
optimizer both designed for a functional language, and error messages good for 
a functional language. This makes then slow for the compiler, and at 
compile-time the compiler burns lot of RAM (they have improved a bit G++ 4.5, 
as template instantiations are now looked up using hash tables: 
http://cpptruths.blogspot.com/2010/03/faster-meta-programs-using-gcc-45-and.html
  but it's a long way to go).
- C++ templates are powerful, because templates templates are a peek into the 
realm of higher order types (kinds), but there is not much typing on the types, 
so bugs are common. The Concepts were a way to add a type system to template 
arguments, but it has failed.
- C++ programmers sometimes don't know much about functional programming. But 
in the end the complexity of functional programs written with C++ templates is 
very limited, they are often almost trivial. What makes them hard to write is 
not that, it's the way you have to write such little functional programs.

and that generates a very bad scenario for "templates"

because if you find (as an newbie)

a small and understandable template code example
-> these code normaly don't show the potential behind templates/generics...

and if you see code that realy profits from using templates/generics
you can't see the profit because its hidden under masses of C++ evil syntax orgies

Reply via email to