[webkit-dev] Should overridden methods use 'virtual' keyword in addition to 'override'?

Darin Adler darin at apple.com
Fri Mar 4 10:54:00 PST 2016


I think when de-finalizing the class we likely don't want to de-finalize all the overrides. Only ones where we need to override.

— Darin

Sent from my iPhone

> On Mar 4, 2016, at 10:39 AM, Konstantin Tokarev <annulen at yandex.ru> wrote:
> 
> 04.03.2016, 21:32, "Darin Adler" <darin at apple.com>:
>> Here are three other loose ends I am thinking about:
>> 
>> - Style guide should say that in a class marked final, virtual functions should all be marked final, not override and certainly not virtual. Agreed?
> 
> I agree about virtual, but not sure about override. Class is already final so any code trying to override memeber already doesn't compile, OTOH if later we decide to de-finilize class it would require a lot of line changes.
> 
> But I agree that all-final style has certain visual appeal.
> 
>> Can we check that with the script? 
> 
> It's certainly possible.
> 
>> Apply that rule globally like we just did with the other rules with do-webcore-rename?
>> 
>> - Style guide should encourage programmers to use final instead of override whenever possible. I suspect many of the functions that currently are tagged override should be final instead. Agreed?
>> 
>> - Style guide should discourage virtual on destructors where the destructor is already virtual due to a base class. This is now more consistent with the use of virtual on other member functions, final would be on the class, override doesn’t need to be stated. Agreed?
>> 
>> — Darin
>> _______________________________________________
>> webkit-dev mailing list
>> webkit-dev at lists.webkit.org
>> https://lists.webkit.org/mailman/listinfo/webkit-dev
> 
> -- 
> Regards,
> Konstantin


More information about the webkit-dev mailing list