<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><span></span></div><div><div><span></span></div><div><div><span></span></div><div><div><span></span></div><div><div><span></span></div><div><div>2016/07/19 16:43、Brent Royal-Gordon via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> のメッセージ:</div><div><br></div><blockquote type="cite"><div><blockquote type="cite"><span>On Jul 18, 2016, at 11:04 PM, Gwynne Raskind via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>Denial of subclassing has always been opt-in in ever other language I’ve used (C++ and Java, to name two, and Objective-C (and older C++) don’t even have that much). Sealing a class against subclassing is one thing, but not providing any kind of escape hatch, any kind of IUnderstandThatSubclassingMayCauseSunsToGoNovaOrGalaxiesToExplode marker, hamstrings all users of the code. Opt-in sealing at least constrains this scenario to places where the framework writer thought it was worth adding the extra protection against horrible horribleness.</span><br></blockquote><span></span><br><span>You know, one thing I haven't seen mentioned is that, just as sealed-by-default preserves the options of library programmers, it also preserves the options of the language itself.</span><br><span></span><br><span>Suppose the people who think this is a huge mistake are correct, and we ultimately conclude that sealed-by-default is a disaster. What can we do about it? Well, we change Swift 3+n to open all classes by default. This would be source- and binary-compatible with all existing code; the only wrinkle is that classes compiled with a sealed-by-default compiler would still be sealed. (And that's not even a problem yet, since stable ABIs are not a thing yet.)</span><br></div></blockquote><div>This is exactly my thought as well, if it does end up not optimal it can always be changed back in a subsequent update.</div><br><blockquote type="cite"><div><span>The reverse, however, is *not* true. Going from open-by-default to sealed-by-default is source- and binary-incompatible. If we don't do it now, we may never be able to do it.</span><br><span></span><br><span>That means this is our one chance to try this. The outcome is uncertain; there are good arguments that it will improve things, but there are also good arguments that it will make things worse. But if we're afraid to try this now, we'll never be able to try it again, and we won't know if it would have worked. Whereas if we *do* try it now, we can always roll it back later.</span><br></div></blockquote><div>I got the feeling that's why this is being pushed now and not swift 3.1 or 4...</div><br><blockquote type="cite"><div><span>Software quality is one of the biggest problems our profession faces. We handle crushing amounts of complexity, teetering towers of abstraction, intertwined code that's at the ragged edge of our ability to comprehend it. Quite possibly the most urgent need in our industry is tools to help us manage it.</span><br></div></blockquote><div>This is implicitly the reason that I changed my +0 to +1, alot of software is crap and it's crap because we don't get a handle on complexity, and this has a potential to reign some things in and bring a little discipline where it's needed.</div><div><br></div><div>I was originally very very against this, but as I thought about it I realized my only "real" reason at the end of the day was fear: fear of loosing certain flexibility, fear of loosing a tool I have used in the past, fear of change (again only speaking for myself) ... and really what I'm getting in return for that change though is the <i>potential</i> for some real increase in reliability (and maybe a lot of performance) on all sides. </div><div><br></div><div>Things really teeter out of control I think because we can do all this crazy stuff behind the back of everything else and while this gives great flexibility to do some truly remarkable things, it also piles up on top of itself and mucks things up... it works until it doesn't... and while the objc world is much more disciplined than others, my experience in the PHP/JavaScript side of things makes me never want to go back to that place... infinite regresses into over-complexity... </div><br><blockquote type="cite"><div><span>Sealed-by-default might turn out to be a powerful tool for managing complexity, helping us prevent unexpected interactions between the implementation details of separate modules. Or it might not. But we ought to find out. If we always take the conservative option, if we always stick to the tried and true, we will never advance the state of the art, never find solutions to the problems that make "all software sucks" a truism.</span><br></div></blockquote><div>Agreed, and I'm ironically reminded of the old days (as a barely conscious human being) where everyone was poopooing objective-c and why don't we just stick to codewarrior and metrowerks and c++... new is bad and what we had is just fine, interface builder is weird, oh and those square brackets what are those etc etc... I'm not saying this is the same thing or that arguments against this proposal are not merited (of course they're merited) but it's a trade off and I think what we would get in return would be huge and potentially more useful in the long run. (wow have i come full circle...)</div><div><br></div><div>Maybe we do need to be able to unscrew the bottle and be able to override something forcefully as a last resort and maybe I should have not voted a full +1 because I agree with others that it's an important function... but in any case I think we should take a deep breath and long term think about what is really trying to be accomplished.... </div><br><blockquote type="cite"><div><span>We need to be bold and take a chance. If it doesn't work out, we can undo it. But if it does work out, we'll be better for it.</span><br></div></blockquote><div>+1000 yes</div><div><br></div><div>Andre</div><br><blockquote type="cite"><div><span>-- </span><br><span>Brent Royal-Gordon</span><br><span>Architechies</span><br><span></span><br><span>_______________________________________________</span><br><span>swift-evolution mailing list</span><br><span><a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a></span><br><span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br></div></blockquote></div></div></div></div></div></body></html>