Broken?

Daniel Murphy yebbliesnospam at gmail.com
Wed Mar 12 05:20:41 PDT 2014


"Andrei Alexandrescu"  wrote in message news:531F70ED.3040304 at erdani.org...

On 3/11/14, 1:18 PM, Vladimir Panteleev wrote:

> A combination of both. The change would break a lot of code and it seems 
> to me final vs. virtual by default is a judgment call more than an obvious 
> decision in favor of final. That said, if I'd do things over again I'd 
> advocate final by default. But we're not doing things over again.
>
> Andrei

FWIW this is exactly where I was back before dconf13.

I was convinced when I realized that:
- It is impossible for the optimizer to achieve the same performance in all 
cases thanks to dynamic linking
- Linking with C++ usually requires marking _almost_ every method with 
'final'
- Only the introducing virtual methods need to be changed, so the breakage 
is actually very small and trivially handled

So after 5 minutes of adding 'virtual' where the compiler tells me to, I can 
delete a whole bunch of cruft from my code and keep the same performance.

(Note that those 5 minutes can be done at your leisure over the years it 
takes for this to progress through the deprecation stages) 



More information about the Digitalmars-d mailing list