[swift-evolution] Final by default for classes and methods

Tino Heth 2th at gmx.de
Wed Dec 23 11:25:29 CST 2015


> The benefits of it far out weight the fears of having it.
so what is the practical problem that's solved by final that convinced you?

I also would change the list of downsides and put "annoyance" on top — especially for those who don't care for theoretical improvement when they have to pay the price in form of more effort:
"If I don't want to subclass something, I just don't do it — why do I have to change the properties of the superclass?"

Also:
- structs are always final, inheritance is one of the major aspects of class. In many cases, the decision for class is made because of the ability to subclass.
- you can't subclass across module borders with the default visibility
In summary, final already is very common, and I don't see the need to push this further just because "inheritance" became old-fashioned lately.

Best regards,
Tino
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20151223/12926322/attachment.html>


More information about the swift-evolution mailing list