I need help in better understanding the usual quote "Avoid dynamic casts".
The thing is, all but the simplest hierarchies do not have deriveds providing new interface that is not, and could not, be present in the base class.
Giving the base class no-ops is one of the solutions, however it seems to me it is not very pretty for the interface to provide functionality that is in fact, for all that matters, non-existing. It's like pressing that button on the vendor machine and nothing happens.
What I'm starting to realize is that dynamic casts are in fact a "common" part of any code. Sure, one shouldn't happily cast down, but the advise is perhaps more intended towards performance issues (considering how slow these casts apparently are) and towards those of us who happily cast without at least trying to review their class design.
Is this so? Ot is there a better pattern I can look for that will considerably reduce the need to use dynamic_cast?