Re: more inheritance patterns
* Mick Charles Beaver:
Alf P. Steinbach <alfps@start.no> wrote:
1. Name that starts with underscore followed by uppercase, "_MyClass",
is reserved for the implementation.
I agree that should change.
2. Non-virtual member functions can't be overridden.
This is a programmer enforced design, which requires never using a
pointer to the "abstract" base class. It's a high-performance
requirement, where virtual functions have too high of an overhead and
must be avoided.
Have you measured, and if so, what were the results?
It's interesting if you have done so, because to the best knowledge available
virtual functions have near to zero overhead.
It's the compile-time version of using a pure-virtual
base class.
3. Direct includes of platform-specific definitions pollutes namespaces
with platform-specific things.
That is certainly the case, and purposefully so. Other parts of the code
base can then #ifdef small sections out where calls to the derived
platform-specific class can be made.
#ifdef-based code is a point number 4.
It seems you folks go out of your way to create an unmaintainable mess. :-(
If was weened off #ifdef-based code in 1985 or thereabouts. You don't need it.
It's stupid.
Cheers,
- Alf
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?