<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=""><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 21, 2015, at 10:56 AM, Tino Heth <<a href="mailto:2th@gmx.de" class="">2th@gmx.de</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">oh, cool - discussion ;-)</div></div></div></blockquote><div><br class=""></div><div>Yes, discussion is good! I really want to see this seriously considered from all angles and the best decision made as an outcome.</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=""><blockquote type="cite" class=""><div class=""><div class="" 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;">However, any Swift application is necessarily going to have a lot of classes as the Cocoa frameworks require apps to subclass framework classes in many instances. Even when we are not required to<span class="Apple-converted-space"> </span><i class="">subclass</i> a framework class they often require our types to be a class, for example when we are providing a delegate to a Cocoa class. These requirements of the frameworks result in<span class="Apple-converted-space"> </span><i class="">a lot</i> of classes in Swift applications that are not ever intended to be subclassed.</div></div></blockquote><div class="">So you'd vote for making non-final the default again as soon as the "Cocoa-legacy" is gone?</div></div></div></div></blockquote><div><br class=""></div>Probably not. I think it is less clear and less safe. I would only consider a change in my opinion if superclasses became extremely common in application level code. I don’t expect to see that happen. </div><div><br class=""></div><div>We are learning to use techniques such as protocols and composition which are more robust than inheritance. I believe the use cases where inheritance is the best solution will continue to decline as our languages become more powerful and we learn how to best use the new features.</div><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=""><blockquote type="cite" class=""><div class=""><div class="" 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;">You ask why I don’t think `inheritable` should be the default. I believe I have addressed that by making a case that it is<span class="Apple-converted-space"> </span><b class="">less clear</b> and<span class="Apple-converted-space"> </span><b class="">less safe</b> as a default.</div></div></blockquote>Sorry if he overlooked something, but I thought the arguments were against the current default…</div></div></div></blockquote><div><br class=""></div><div>The current default is to allow inheritance by default. This is the same as `inheritable`, we just don’t have a keyword for it as it isn’t necessary. So yes, the argument is against the current default, which is the same as `inheritable` by default.</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="">What exactly compromises safety when a subclass is allowed to monitor usage of its inherited methods?</div></div></div></blockquote><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="">True, when a method is overwritten, the base class might lose something it relies on; but when this can't happen, can you point out an example where this behavior causes danger (damn, I actually know one, but you have to tell first ;-).</div></div></div></blockquote><div><br class=""></div>This discussion is around making <i class="">classes</i> final by default. I also believe <i class="">methods</i> should be final by default but that is a separate discussion. Let’s stay focused on the discussion about classes in this thread.</div><div><br class=""></div><div><br class=""></div><div><br class=""></div><br class=""></body></html>