[swift-evolution] Final by default for classes and methods

Rod Brown rodney.brown6 at icloud.com
Thu Dec 17 20:48:53 CST 2015


I completely agree. We have the final keyword for that, ensuring that if I do not plan for it to be subclassable, it cannot be.

The question here is not “should a framework author be able to block a developer from subclassing?” but “Should I assume it is, or is not, subclassable?"

I err on the side of flexibility. Others err on the side of simplicity and safety.


> On 18 Dec 2015, at 1:30 PM, Matthew Johnson <matthew at anandabits.com <mailto:matthew at anandabits.com>> wrote:
> 
> Legitimacy is in the eye of the beholder.  I think it is quite legitimate for a framework author (especially the platform vendor) to decide what you can and cannot do with their framework. 

> 
> When I hear about code in Apple’s frameworks that is responsible detecting and working around inappropriate uses of their frameworks it makes me cringe.  Anything that helps to remove the need for this in the long run is a really great thing. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20151218/b8272fe0/attachment.html>


More information about the swift-evolution mailing list