<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 21, 2015, at 1:26 PM, Jordan Rose via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Dec 20, 2015, at 3:40 , Tino Heth via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""><blockquote type="cite" class=""><div class=""><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">Frankly, I think having `final` in the language at all is a mistake. While I agree that we should prefer composition to inheritance*, declaring things final is hubris. The only reasonable use case I've seen is for optimization, but that smacks of developers serving the compiler rather than the converse. Bringing an analog of NS_REQUIRES_SUPER to Swift would be most welcome; that's as far as I'd go down the path of dictating framework usage.</div></div></blockquote></div>I really like the direction this discussion has taken ;-):<div class="">Is there any counter argument beside performance (which imho should always be seen under the aspect of premature optimization) that speaks against making NS_REQUIRES_SUPER the default behavior?</div></div></div></blockquote><br class=""></div><div class="">I personally don't like this but I can't put my finger on why. Obviously there are some things where you really don't need to call super (mostly abstract methods), but you just said "default", which implies that we could have an opt-out attribute.</div><div class=""><br class=""></div><div class="">I will say, however, that making NS_REQUIRES_SUPER the default for overridable methods is separable from deciding which methods are overridable by default. Making sure the base method is called isn't really the same as knowing the base method is <i class="">all</i>&nbsp;that's called.</div></div></div></blockquote><div><br class=""></div><div>Agree. &nbsp;There are at least four possibilities from most to least restrictive:</div><div><br class=""></div><div>* not overridable</div><div>* overridable but requires a call to super in a specific location in the overriding method (i.e. the first or last line)</div><div>* overridable but requires a call to super somewhere in the overriding method</div><div>* overridable with no restrictions</div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""></div><div class="">Jordan</div><br class="">
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=eLFMrKDT8iBxZ-2Fbnk-2BZqvSchNN-2FvYXdceA0T7VxwkAchFS8UD5Pyp1w4QbM1CcK9xmwCAN1tqgpq4VS-2B2qHptZ0Kar2bKHvm8McUo7Vs7dUKMEPpeXJfY8lkiB-2F0UwDfGZ9hSVrJr4bdSpRcoUvmEwpjmFc6unhfoGL-2B1sFsaqHyNk02VsQ2jN9UkU1AnQSDr-2FD-2BoQ4kXJ3tU2j3-2FiMcDKJu6A33j76j7PH6qXADH-2FI-3D" alt="" width="1" height="1" border="0" style="height:1px !important;width:1px !important;border-width:0 !important;margin-top:0 !important;margin-bottom:0 !important;margin-right:0 !important;margin-left:0 !important;padding-top:0 !important;padding-bottom:0 !important;padding-right:0 !important;padding-left:0 !important;" class="">
</div>
_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></body></html>