Editor's Forum


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 Stroustrup’s 3rd Edition and Scott Meyers’ 2nd Edition of Effective C++), and my article, “What’s 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. I’ve never been so delusional as to think I knew even “most everything” about anything (I’m 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 one’s craft. If the craft is software development, I’m still in good shape; if it’s purely C++, I’ve 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 what’s 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 don’t 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 Cargill’s 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 Moo’s treatment of the subject this month is the clearest you can find in print.

A quote from that article reads thus:

And that’s 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, I’ll be taking Haw’s 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 Johnson’s book about dealing with change, Who Moved My Cheese?

[4] I would be severely amiss, of course, if I didn’t 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 Vandervoorde’s and Al Vermuelen’s 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 Herb’s 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