
"Scott Meyers"
EvengLog log; log.WriteEntry("Hello World"); // throws: no log stream was set
I think the biggest argument for the compile-time error detection has always been something like: EvengLog log; if (some runtime condition) log.WriteEntry("Hello World"); Then, this "some runtime condition" may never be tested, and the code will throw in production. It seems to me that the worlds of OO and C++ split some time ago, and moving more and more appart. The new OO books now use Java and C# for their examples. OTOH, most of what's going on in C++ world now is related to language-specific features. I got the impression that people from objectmentor are ready to substitute compile-time error detection with testing. Of course they are familiar with the argument above, so for them it's probably not a big deal. I think neither of approaches is clearly superior, both have benefits and drawbacks, and it depends on each particular user and task which one would work better. But in general, I would vote for complete construction with default arguments and/or overloaded constructors for simplicity. Regards, Arkadiy