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

Tino Heth 2th at gmx.de
Tue Dec 22 03:43:13 CST 2015

> I can see why you view it this way, but access control and inheritability are orthogonal.
as I understand orthogonal (mathematical background), it is definitely not the case:
I can't inherit what I cannot access, so there is one impossible combination of the two attributes.

The argumentation that "users of your framework could cause trouble (what they will do anyways ;-) with overriding" looses traction when you have to add "of cause that only applies to classes you made explicitly accessible to them".

Final is right in theory, but in real software, classes are rarely designed for inheritance — it just happens (and I'm quite sure most real software is build by people who would shrug of such discussions as academic nonsense ;-).

Btw: I wouldn't oppose a proposal to allow changing conventions like this (there are at least two other discussions about the best default) on a per module/file basis — as long as the "local" effect of the setting isn't vital, there shouldn't be a problem with customizing.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20151222/849adb7d/attachment.html>

More information about the swift-evolution mailing list