Slow performance compared to C++, ideas?

Jonathan M Davis jmdavisProg at gmx.com
Wed Jun 5 18:14:08 PDT 2013


On Wednesday, June 05, 2013 17:49:17 Walter Bright wrote:
> I think we accomplish this in a simpler way:
> 
> 1. 'virtual' means a method is an "introducing" one.
> 2. 'override' means a method overrides a base virtual function with a final
> function.
> 3. 'override virtual' means override with a non-final function.
> 4. none means final and non-overriding.

I would have expected something more like

1. 'virtual' means a method is an "introducing" one.
2. 'override' means override with a non-final function.
3. 'final override' means a method overrides a base virtual function with a 
final function.
4. 'final' by itself both mean final and non-overriding.

I think that it would be confusing for final to be implied if virtual is not 
used with override, and I'd argue that virtual should only go on the 
"introducing" one. Doing so will mean less anotation, will be less confusing 
IMHO, and will break less code. If override by itself means override non-final, 
then every case of override that we currently have is valid, and all that 
needs to be changed is that introducing functions will need to be marked as 
virtual. Then the only real changes are

1. Functions not marked with virtual or override are final.
2. Introducing functions must be marked with virtual.

What you're suggesting would be a larger change, and I don't see how it would 
be better.

- Jonathan M Davis


More information about the Digitalmars-d mailing list