[swift-evolution] [Proposal] Sealed classes by default

Sean Heber sean at fifthace.com
Tue Jun 28 09:55:31 CDT 2016


> On Jun 28, 2016, at 9:52 AM, Mark Lacey via swift-evolution <swift-evolution at swift.org> wrote:
> 
>> 
>> On Jun 27, 2016, at 9:10 PM, L. Mihalkovic via swift-evolution <swift-evolution at swift.org> wrote:
>> 
>> -1 for the fact that if all devs can write working code, fewer can do it in a clear structured fashion that is well designed for extensibility.
> 
> This sounds more like an argument for having sealed classes than not. As the proposal points out in the motivation, if the base class is not designed with subclassing in mind then overriding methods can result in unintended behavior (e.g. crashing, or other bugs).

But I think the counter argument is, what if you need to fix or workaround unintended behavior of the class you’re trying to use?

l8r
Sean



More information about the swift-evolution mailing list