jeffc said:
It's funny that sometimes even "experienced" C++ programmers will argue with
me about this. Something doesn't work, they'll see the lack of the
"virtual" keyword in the subclass, and try to tell me the problem is because
it's missing.
We have a simple interview question concerning three classes Base,
Derived1, and Derived2. With a virtual function, and virtual destructor.
Question is "What does this print?" The answers can be very strange, but
basically a large portion of those questioned think that leaving off
virtual in the derived class makes it none virtual.
In telephone interviews I conducted to the question "When did you last
design a class heirarchy?" two out of three responded "I've never done
that!" Our conclusions are that a number of 'C++ programmers' have never
derived a class heirarchy in C++ and mostly write code to interact with
some database API.