On 1/5/2012 1:16 AM, Manu wrote:
On 5 January 2012 03:06, Walter Bright <[email protected] <mailto:[email protected]>> wrote:On 1/4/2012 4:30 PM, Sean Kelly wrote: If a library is written without consideration to what is virtual and what is not, its performance will be the least of your problems. I agree. Such is a massive failure in designing a polymorphic type, and the language can't help with that. I don't follow.. how is someone failing (or forgetting) to type 'final' a "massive design failure"? It's not a design failure, it's not even 'wrong'... it's INEVITABLE. And the language CAN help with that, by making expensive operations require explicit declaration.
In any class design, one must decide which functions are overrideable and which are not. The language cannot do it for you; certainly not by switching around the default behavior.
> At least make a compiler flag so I can disable virtual-by-default for my project...?
I'm afraid that such a switch would have disastrous results, because it fundamentally alters the meaning of existing code.
