New Cheese
There was a time in the mid-to-late 90s that I considered myself a C++ expert (whatever that means). I would imagine it lasted for about, say, two months. I had spent most of that decade participating on the C++ standards committee, writing some pretty dang good C++ code, and teaching all over the country. My book [1] was the third on the market to be compliant with the recently-established C++98 Standard (after Stroustrups 3rd Edition and Scott Meyers 2nd Edition of Effective C++), and my article, Whats New in Standard C++? [2], was well received and quoted a number of times in other places. Then somebody moved my cheese [3].
Not that being an expert is important, let alone well defined. Ive never been so delusional as to think I knew even most everything about anything (Im still picking up insights on C, for goodness sake), but it does feel good once in a while to display a noticeable level of mastery of ones craft. If the craft is software development, Im still in good shape; if its purely C++, Ive a little catching up to do. (The fact that I must now teach such a vast variety of college subjects may have something to do with it). There was a day when mastery of a programming language lasted for a while (I was a FORTRAN expert for years, not just months :-), but no more. After a brief (and fruitful) detour into the wonderful world of Java, I returned to C++ Land with a mouthful of others dust.
So whats new since Standard C++? Most notably, template metaprogramming and exception-safe design, I would say. Template metaprogramming, C++s curious language within a language, came about as a happy accident. Templates began as a mechanism for type-safe containers of T and were refined further to make STL doable; I dont think anyone gave a passing thought to the fact that the template facility constituted a compile-time, Turing-complete language in its own right. Now there are entire libraries that perform most of their magic before you can even say go at run time. If this is all new to you, have a look at the contributions from columnists Thomas Becker and Steve Dewhurst in this issue [4].
Tom Cargill gave the C++ industry a bit of a scare at the end of 1994 in his infamous article, Exception Handling: A False Sense of Security [5]. Some of us began to wonder if we had created a monster by adding exceptions to the language. Over time, all of Cargills issues have been resolved (not without deliberate effort on your part, however), thanks to pioneering work by Greg Colvin, David Abrahams, and Herb Sutter [6], among others. Not surprisingly, Koenig and Moos treatment of the subject this month is the clearest you can find in print.
A quote from that article reads thus:
We first discussed handles in the Journal of Object-Oriented Programming, then expanded on that discussion in Ruminations on C++, and, most recently, used generic handles as an implementation vehicle in Accelerated C++. During that time, our understanding of handles and how to use them has evolved. In particular, we along with others in the C++ community have begun to appreciate how much more useful a general-purpose tool such as a handle can be if it behaves sensibly in the face of exceptions.
And thats the point: things change. Our understanding evolves (or at least it should). Languages and tools and all other such worthwhile creations from the mind of man must progress or fade into oblivion. So while I clean the dust out of my mouth, Ill be taking Haws advice [7]: Savor the Adventure and Enjoy the Taste of New Cheese.
Notes
[1] C & C++ Code Capsules: A Guide for Practitioners (Prentice-Hall, 1998).
[2] C/C++ Users Journal, December 1998.
[3] As you may surmise, I recently read Spencer Johnsons book about dealing with change, Who Moved My Cheese?
[4] I would be severely amiss, of course, if I didnt mention some related must-reads: Generative Programming by Czarnecki and Eisenecker, and Modern C++ Design by Andrei Alexandrescu. Pioneering work related to template metaprogramming surfaced in David Vandervoordes and Al Vermuelens independent work on Expression Templates.
[5] C++ Report, November-December 1994. This magazine is no longer available, but the article appears on Scott Meyers Effective C++ CD-ROM.
[6] See Herbs books, Exceptional C++ and More Exceptional C++.
[7] From Spencer Johnson, M.D. Who Moved My Cheese? (Putnam, 1998).
Chuck Allison
Senior Editor
cda@freshsources.com