On Wednesday, 4 December 2013 at 07:00:58 UTC, Manu wrote:
The majority of functions in most OOP classes are properties
and trivial
accessors which should almost never be virtual. Imagine, making
virtual
function calls to access trivial properties? They can't be
inlined anymore;
inlining trivial accessors is one of the most important
optimisations for
OOP that there is.
This is an absolutely important point that should be considered
the foundation for the argument for final-by-default. Your
average programmer is NOT going to tag everything as final, and
the cost of virtual accessors could be tremendous. There's no
argument for virtual-by-default that is nearly as powerful as
this.