[swift-evolution] Final by default for classes and methods
felipe at cypriano.me
Thu Dec 24 01:25:48 CST 2015
On Wed, Dec 23, 2015, at 20:09, Andrey Tarantsov wrote:
>> Isn't this proposal solving a problem that in practice doesn't exist
>> or isn't common enough to be worth a language level fix?
> Well I have a TextExpander macro that inserts "// override point" when
> I type ;overp. Been marking all overridable methods this way for
> years. I think it's an indication that the problem is worth solving.
>> I'm trying to find an example of a common problem - in any language -
>> that would benefit by having final/sealed by default.
> Understanding the code and reasoning about the class is easier when
> you know the exact customization points.
> I do agree that this won't really prevent many actual bugs.
Those are good points and things I came to realize after I asked that. I
don't have a Text Expander snippet but it is common in the code I work
to have some kind of hack to inform what is intended to be overrided.
Thanks for sharing, this is exactly the kind of answer (not because it
is in favor of final) I was hoping to get when I asked.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution