S
Steven T. Hatton
Perhaps I'm just a bit frustrated, and I will soon realize the clear truth
of the matter, but right now I have some serious misgivings about the value
of investing a lot of time and effort into template programming. I just
finished reading the first 12 chapters of _C++ Templates: The Complete
Guide_. One thing that struck me as I read these chapters is how much I
didn't know about C++. I _know_ the core language specification is
contained in a finite document, but I sometimes get the sense that C++
requires an infinite amount of learning.
The primary C++ language (without templates) is substantial and quite
powerful in itself. There are many aspects of that which I have yet to
fully master. While I will grant that working with templates can help
shore up some of those skills, I have to wonder how useful templates really
are. I have discovered that code using templates can frequently not behave
as I expect or want. An example is the std::for_each algorithm. I use the
for-each idiom frequently in other languages, and also use the Cpp
implementation provided with Qt (though that has significant limitations in
its own right). The std::for_each, however, has proved virtually useless
to me.
Will a programmer who knows how to use templates very well be significantly
more productive than one who sticks to the traditional OOP aspects of C++?
of the matter, but right now I have some serious misgivings about the value
of investing a lot of time and effort into template programming. I just
finished reading the first 12 chapters of _C++ Templates: The Complete
Guide_. One thing that struck me as I read these chapters is how much I
didn't know about C++. I _know_ the core language specification is
contained in a finite document, but I sometimes get the sense that C++
requires an infinite amount of learning.
The primary C++ language (without templates) is substantial and quite
powerful in itself. There are many aspects of that which I have yet to
fully master. While I will grant that working with templates can help
shore up some of those skills, I have to wonder how useful templates really
are. I have discovered that code using templates can frequently not behave
as I expect or want. An example is the std::for_each algorithm. I use the
for-each idiom frequently in other languages, and also use the Cpp
implementation provided with Qt (though that has significant limitations in
its own right). The std::for_each, however, has proved virtually useless
to me.
Will a programmer who knows how to use templates very well be significantly
more productive than one who sticks to the traditional OOP aspects of C++?