<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body><div style="font-family:Arial;">To be fair and practical with the proposal it does not remove the ability to inherit any of the UIKit classes because all Objective-C classes are imported as "open".<br></div>
<div style="font-family:Arial;">&nbsp;</div>
<div style="font-family:Arial;">Food for thought on inheritance-is-the-only-fix, how have we worked all these years with C libraries like Security, Foundation, Core Graphics, GCD, and so on if C doesn't have inheritance? My point here is not to suggest anything other than to keep an open mind, the proposal is not removing OO from Swift. It is definitely a non conventional approach when compared to other languages, Kotlin is the only language with something similar but I have never used it.<br></div>
<div style="font-family:Arial;">&nbsp;</div>
<div style="font-family:Arial;">I have seen a lot of problems being solved by inheritance that could be solved by composition in a way that was more reliable, testable, and clear. When I asked why inheritance the answer is most of the time because that is the way they know how to do things, like it was the only tool available. I think Swift has as opportunity to increase software quality by providing good defaults that make developers understand what are the consequences of their choices. Maybe I'm too optimistic.<br></div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>On Thu, Jul 7, 2016, at 16:01, Aditya Krishnadevan via swift-evolution wrote:<br></div>
<blockquote type="cite"><div>I agree with everything James has to say here. Making classes non-subclassable by default is not optimal.&nbsp;<br></div>
<div>A lot of fixes for small bugs in UIKit involve using a subclass that overrides at method or slightly modified behaviour as a temporary patch until the issue is fixed at the framework level.&nbsp;<br></div>
<div>Preventing this <b>and</b> introducing a new keyword simply adds to the complexity without bringing too much to the table.&nbsp;<br></div>
<div><div style="font-family:Arial;">&nbsp;</div>
<div style="font-family:Arial;">Aditya Krishnadevan.&nbsp;<br></div>
</div>
<div><div style="font-family:Arial;">&nbsp;</div>
<div style="font-family:Arial;">On 06-Jul-2016, at 6:03 PM, James Campbell via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br></div>
</div>
<blockquote type="cite"><div><div dir="ltr"><div style="font-family:arial, helvetica, sans-serif;font-size:small;color:rgb(0, 0, 0);">-0.5 I think preventing subclassing is a bad idea, sometimes there are bugs which can only be resolved by subclassing and this removes a lot of power from app makers.<br></div>
<div style="font-family:arial, helvetica, sans-serif;font-size:small;color:rgb(0, 0, 0);">&nbsp;</div>
<div><div defang_data-gmailquote="yes"><div style="font-family:Arial;">On 6 July 2016 at 13:23, Jacopo Andrea Giola via swift-evolution <span dir="ltr">&lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt;</span> wrote:<br></div>
<blockquote style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204, 204, 204);padding-left:1ex;" defang_data-gmailquote="yes"><div style="font-family:Arial;"><span>&gt;&nbsp; &nbsp; &nbsp; &nbsp;* What is your evaluation of the proposal?<br> <br></span></div>
<div style="font-family:arial, helvetica, sans-serif;color:rgb(0, 0, 0);">Unless someone can prove to me why we wouldn't need this for fixing bugs I still thing this is only a good system to hint at the developer that they shouldn't be using this class unless they have to.<br></div>
<div style="font-family:arial, helvetica, sans-serif;color:rgb(0, 0, 0);">&nbsp;</div>
<div style="font-family:arial, helvetica, sans-serif;color:rgb(0, 0, 0);">I could envision the compiler using the overide keyword to force the developer to acknowledge they are using a non-reccomended class like so:<br></div>
<div style="font-family:arial, helvetica, sans-serif;color:rgb(0, 0, 0);">&nbsp;</div>
<div style="font-family:arial, helvetica, sans-serif;color:rgb(0, 0, 0);">// This class implements a polyfill which fixes a bug in the keychain class<br></div>
<div style="font-family:arial, helvetica, sans-serif;color:rgb(0, 0, 0);">override class PolyfillForKeychainBug: Keychain {<br></div>
<div style="font-family:arial, helvetica, sans-serif;color:rgb(0, 0, 0);">&nbsp;</div>
<div style="font-family:arial, helvetica, sans-serif;color:rgb(0, 0, 0);">}<br></div>
<div style="font-family:arial, helvetica, sans-serif;color:rgb(0, 0, 0);">&nbsp;</div>
<div style="font-family:arial, helvetica, sans-serif;color:rgb(0, 0, 0);">Without this the compiler would throw an error "Non-open class can't be overridden without `override` keyword"<br></div>
<div style="font-family:Arial;"><span><br>&gt;&nbsp; &nbsp; &nbsp; &nbsp;* Does this proposal fit well with the feel and direction of Swift?<br> <br></span></div>
<div style="font-family:arial, helvetica, sans-serif;font-size:small;color:rgb(0, 0, 0);display:inline;">It does in terms of safety but not in terms of simplicity.<br></div>
<div style="font-family:Arial;">&nbsp;</div>
<div style="font-family:Arial;"><span><br>&gt;&nbsp; &nbsp; &nbsp; &nbsp;* If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?<br> <br></span><span></span></div>
<div style="font-family:arial, helvetica, sans-serif;font-size:small;color:rgb(0, 0, 0);display:inline;"><span>It works like Java but I never liked final</span><br></div>
<div style="font-family:Arial;">&nbsp;</div>
</blockquote><div>&nbsp;<br></div>
<blockquote style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204, 204, 204);padding-left:1ex;" defang_data-gmailquote="yes"><div style="font-family:Arial;"><span>&gt;&nbsp; &nbsp; &nbsp; &nbsp;* How much effort did you put into your review? A glance, a quick reading, or an in-depth study?<br> <br> </span>I’ve read the proposal</div>
<div style="font-family:Arial;">&nbsp;</div>
<div><div><div style="font-family:Arial;">_______________________________________________<br></div>
<div style="font-family:Arial;"> swift-evolution mailing list<br></div>
<div style="font-family:Arial;"> <a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br></div>
<div style="font-family:Arial;"> <a style="" href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br></div>
</div>
</div>
</blockquote></div>
</div>
</div>
</div>
</blockquote><blockquote type="cite"><div><div style="font-family:Arial;"><span>_______________________________________________</span><br></div>
<div style="font-family:Arial;"><span>swift-evolution mailing list</span><br></div>
<div style="font-family:Arial;"><span><a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a></span><br></div>
<div style="font-family:Arial;"><span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br></div>
</div>
</blockquote><div><u>_______________________________________________</u><br></div>
<div>swift-evolution mailing list<br></div>
<div><a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br></div>
<div><a href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br></div>
</blockquote><div style="font-family:Arial;">&nbsp;</div>
</body>
</html>