quote: Original post by ph33r
So making a function virtual "in case" has no real effect that I can tell.
A base class'' invariant behaviour, the behaviour which is part of the generalisation of its derived classes, should not be made up of virtual functions. When you make a function virtual you are specifically stating that the details of how the function fulfils its task may differ in derived classes. If this is not the case, then the function does not make sense if it is declared virtual. There should be no "in case".
quote: Original post by SabreMan
they say "well, someone might want to inherit from this class, so I''ll make the functions virtual"
One of Meyers'' points, IMO, applies to unnecessarily pondering whether you may need to derive from your class. "Make non-leaf classes abstract." That means that you should only ever instantiate objects from the most derived classes. All base classes should be abstract. So if you think you may need to derive from your class later than it''s destined to be a generalisation. It changed my perspective on a few things. But I''m unsure of how much people follow that rule and how important it is. I, personally, really like the theory behind it.