<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><blockquote type="cite" class=""><pre style="white-space: pre-wrap; background-color: rgb(255, 255, 255);" class="">* What is your evaluation of the proposal?
</pre></blockquote><div class="">A **strong** -1</div><div class=""><br class=""></div><div class="">First, I have often found that you can’t always predict the way which something will need to be extended. &nbsp;You think you know, but are then surprised by creative uses. &nbsp;My favorite features of Swift/Cocoa involve retroactive modeling.</div><div class=""><br class=""></div><div class="">Second, I don’t think this proposal will achieve its stated objective of forcing people to think about subclassing more. &nbsp;It will just add confusing boilerplate. &nbsp;</div><div class=""><br class=""></div><div class="">Things like Swift optionals work well because they make the (often forgotten) choices explicit in the context that they are used. &nbsp;In the world of Human Factors, we call it a forcing function. &nbsp;This proposal has the inverse structure, and will be ineffective, because <b class="">the “forcing” part of it shows up in a different context</b> (i.e. trying to use a framework) <b class="">than the decision is being made in</b> (writing the framework). &nbsp;This type of thinking leads to things like Java and the DMV.</div><div class=""><br class=""></div><div class="">As Tino said:</div></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><blockquote type="cite" class=""><pre style="white-space: pre-wrap; background-color: rgb(255, 255, 255);" class="">No matter what the defaults are, good libraries are hard to build, so I predict this proposal would not only fail in increasing framework quality, but also will make it much harder for users of those frameworks to work around their flaws, which are just a natural part of every software.</pre></blockquote></div></blockquote><div class=""><div class="">I think he is right on here. &nbsp;Those who were prone to be thoughtful about their design would have been anyway. &nbsp;Those who are not thoughtful about their design will just leave these annotations off… leaving us with no recourse to extend/modify classes. &nbsp;When people complain, they will add the annotations without actually thinking about the meaning (i.e. stack overflow / the fixit tells me I need to add this word to make the compiler happy). &nbsp;All this does is put framework users at the mercy of the framework writers.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Finally, this proposal is missing important aspects of the problem space. &nbsp;If we truly want to solve the issue of subclassing, we need to consider all of the common issues which arise. &nbsp;Looking at the cocoa documentation you will see several types of annotations:</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>1) This method MUST be overridden</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>2) This method should NOT be overridden</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>3) This method MUST be called</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>3) This method should NOT be called except by subclasses</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>4) This method should NOT be called except by a method override calling super</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>5) This method MUST call super</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>6) Overrides of this method should NOT call super</div><div class=""><br class=""></div><div class="">If we are attempting to bring thoughtfulness to the design of classes, I would like to see things be extendable by default, but with annotations that thoughtful framework designers can use to designate how a particular method should be used. &nbsp;In most cases, it should not explicitly forbid the end user from subclassing, but require them to acknowledge that what they are doing is not intended by the framework. (e.g. "unsafe override func"…). &nbsp;That would feel 1000x more swifty to me. &nbsp;Opt-out safety.</div><br class=""><blockquote type="cite" class=""><pre style="white-space: pre-wrap; background-color: rgb(255, 255, 255);" class="">* Is the problem being addressed significant enough to warrant a change to Swift?
</pre></blockquote>No. It doesn’t actually solve the problem... and I haven’t actually run into this problem in the real world.<br class=""><blockquote type="cite" class=""><pre style="white-space: pre-wrap; background-color: rgb(255, 255, 255);" class="">* Does this proposal fit well with the feel and direction of Swift?
</pre></blockquote>No, it gives Swift more of a feeling of busywork and unnecessary boilerplate while failing to achieve its objective. &nbsp;It goes against the retroactive modeling allowed by other areas of Swift.</div><div class=""><br class=""><blockquote type="cite" class=""><pre style="white-space: pre-wrap; background-color: rgb(255, 255, 255);" class="">* If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?
</pre></blockquote>I tend to avoid languages which require this sort of thing. &nbsp;In other languages that lock things down, there is a need to unlock things soon after (e.g. friend classes). &nbsp;</div><div class=""><br class=""></div><div class="">I predict the same thing will happen here. &nbsp;People will quickly be asking for the ability to patch/override in cases where the framework designer was wrong. &nbsp;That shows a problem inherent with the design...</div><div class=""><br class=""><blockquote type="cite" class=""><pre style="white-space: pre-wrap; background-color: rgb(255, 255, 255);" class="">* How much effort did you put into your review? A glance, a quick reading, or an in-depth study?</pre></blockquote><div class="">Read the proposal &amp; discussion. &nbsp;Read earlier discussions around access control that touched on this subject as well. &nbsp;I have been designing frameworks for years.</div></div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Jon</div><div class=""><br class=""></div><div class=""><blockquote type="cite" class=""><pre style="white-space: pre-wrap; background-color: rgb(255, 255, 255);" class="">Hello Swift community,

The review of "SE-0117: Default classes to be non-subclassable publicly" begins now and runs through July 11. The proposal is available here:

        <a href="https://github.com/apple/swift-evolution/blob/master/proposals/0117-non-public-subclassable-by-default.md" class="">https://github.com/apple/swift-evolution/blob/master/proposals/0117-non-public-subclassable-by-default.md</a>

Reviews are an important part of the Swift evolution process. All reviews should be sent to the swift-evolution mailing list at

        <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a>

or, if you would like to keep your feedback private, directly to the review manager.

What goes into a review?

The goal of the review process is to improve the proposal under review through constructive criticism and contribute to the direction of Swift. When writing your review, here are some questions you might want to answer in your review:

        * What is your evaluation of the proposal?
        * Is the problem being addressed significant enough to warrant a change to Swift?
        * Does this proposal fit well with the feel and direction of Swift?
        * If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?
        * How much effort did you put into your review? A glance, a quick reading, or an in-depth study?

More information about the Swift evolution process is available at

        <a href="https://github.com/apple/swift-evolution/blob/master/process.md" class="">https://github.com/apple/swift-evolution/blob/master/process.md</a>

Thank you,

-Chris Lattner
Review Manager</pre></blockquote><div class=""><br class=""></div></div></body></html>