January 14, 2003

Templates, you've gotta love 'em

Templates are the best discovery that I've had in my software development life - or they are at least in the runnings.

In the last year or so I've begun to really get into powerful C++, beyond the basic function of the language. Almost all of the things that have excited me are template related. Today, in one simple action I generalised a string tokenising function to work on any basic_string derivative class, saving quite a bit of work. I did this simply by making the function a template function.

My windows application writing has switched almost entirely to using WTL and I really feel like I am lots more productive using this than when writing using MFC. Also, through using WTL (and more win32 code) I understand the work that I do with MFC a lot more. I can't help but think that abstracting away the underlying operations like MFC does is harmful to the MFC developer.

It upsets me when I think that I'm only beginning to discover the real power of C++ when Microsoft is trying to persuade me to use the wonderful new C#. This language has no templates, and from what I've seen offers me little more than Delphi does - with a slower execution speed.

Posted by Simon at January 14, 2003 10:35 PM