On Thu, 17 May 2007 18:10:53 +0200, "Johs" <sd***@asd.comwrote:
>I have read that when you are using templates you are making generic
programs. But I don't see whats so generic about templates.
This a common misunderstanding. Alexander A. Stepanov, creator of STL,
writes: "Some of you might have also heard that generic programming is
a style of programming using C++ templates. This is not so. Generic
programming has nothing to do with C++ or templates. Generic
programming is a discipline that studies systematic organization of
abstract software components"
(
http://www.stepanovpapers.com/MusserForeward.pdf).
>You can make
generic programs without templates through the use of function overload and
the virtual functionality.
As I understand when you use templates you just increase the runtime
performance since the code is resolved at compile time.
Function overloading is also resolved at compile time. Late binding
may be an advantage or a disadvantage, depending on the context.
>How come people are
mixing templates with generic programming when all they actually do is
increase runtime performance?
Better performance is always, well, better. In general I agree with
you. Templates are currently overrated in C++.
--
Roland Pibinger
"The best software is simple, elegant, and full of drama" - Grady Booch