Hi WebKit devs,
'final' keyword can be applied to both a class and a method
(non-static member function). I don't know correct terminology for
them. I call them 'final' class specifier and 'final' method
specifier.
I'm now going to update WebKit Code Style Guidelines for using 'final'
class specifier for all classes which has no derived classes in Bug
192844.
I believe this is not controversial. This is not a topic I'd like to
discuss today.
I'd like to discuss which 'override' or 'final' should be used for methods.
Currently, WebKit is using both inconsistently.
For example, CSSFontFaceSet class is marked 'final' and its methods are marked 'final',
while CSSFontFaceSource class is marked 'final' and its methods are marked 'override'.
According to WebKit Code Style Guidelines, 'final' method specifier is
preferable to 'override' if possible. There is a previous discussion
thread.
I'd like to change this because 'final' doesn't necessarily imply
'override'. See the following stackoverflow:
IIUC, 'final' method specifier can be useful for such like the following case:
The 'final' method specifier indicates D can't override the method foo.
Thus, using 'final' method specifier implies other virtual functions
can be overridden. I'm not sure my understanding right. Please correct me.