This Sentence Is False
A child can appreciate the predicament the statement above presents. With four simple words, the mind is swept into the wondrous realms of the unprovable. I am reluctant to admit that I didnt encounter those wonders until I took my first course in the Theory of Computation at the University of Arizona, under the expert tutelage of Dr. Peter Downey. (Please dont ask how long ago that was.) Having previously spent years as a student of mathematics proving theorems, I found the idea of undecidable propositions both intriguing and unsettling. How could this be? Can we not design logical systems that are totally consistent? In a word, no. According to Gödels Incompleteness Theorem, any sufficiently rich system (beyond the complexity of the integers under addition and subtraction, say) will give rise to statements that cannot be proven. Think about it. The mathematical systems that guide our satellites, engineer our societys infrastructure, and govern the development of the innards of the computer you spend so many hours in front of also have potentially frightening inconsistencies black holes, if you will. I see two perspectives on this situation: 1) proceed with caution, lest you create a monster, or 2) throw caution to the wind and partake, while side-stepping those surprising singularities as you encounter them (if youre lucky). I find myself in between the two extremes most of the time. Ah, the joy of lifes complexities!
C++ is a rich logical system. It has many known dark boundaries (labeled undefined or indeterminate by the C++ Standard), and many unknown ones Im sure. Yet it is also sufficiently rich that we are still discovering many new and interesting ways to use it. This fact stands as proof of the soundness of its fundamental design. While you and I may find ourselves longing for but not quite grasping that sense of total mastery over C++ that is so much easier to attain with some other languages, in it we have tools that enrich our experience as problem solvers. Dr. Iverson, inventor of APL, often stressed that language is a tool of thought. The richer the language, the richer the thinking.
Now, please dont get me wrong. Im a lover of the power of simplicity. But I also appreciate Einsteins great statement that solutions should be as simple as possible but no simpler. This maxim guides me as I patiently strive to grow in my mastery of C++. If you think about it, the basic constructs of C++ are simple: the syntax and semantics inherited from C coupled with member functions, operator overloading, templates, exceptions, RTTI, and namespaces and you dont have to use anything you dont need.
Among the many practical solutions in this months issue, I especially appreciate and recommend Herb Sutters counsel on virtual functions and class interface design. The idiom of a non-virtual interface with supporting, non-public virtual functions is not new and is found in the iostream library, but Herbs explanation is the clearest Ive ever read. I also found Matt Austerns extending of the iostream library with function objects quite enlightening.
No one knows everything about C++. (That sentence is true!) What I know makes me useful, and the fact that there is more to discover makes the journey rewarding.
Chuck Allison
Publishers note: CUJ is celebrating its 20th anniversary and we want you to be part of it! In our November 2001 issue, well publish a photograph of our most faithful subscriber with his/her earliest issue of CUJ (or C Users Group Newsletter). If that could be you, see page 48 for details. Well also publish anniversary thoughts from readers if you want to contribute, email cujeditor@cmp.com, with CUJ 20 as subject. Each reader whose photo or message is published will receive a CUJ 20th anniversary t-shirt.
Senior Editor