SE-0117, API Design, and You
A lot of conversation has been going around about SE-0117 this week, as the proposal has entered its Active Review stage.
The tl;dr on this proposal is that all classes that are marked as
public will not be able to be subclassed unless also marked
open. Additionally, it’s functions, variables, and subscripts would also not be overridden unless explicitly marked as
open. This means that classes will end up having behavior that some have dubbed “
final by default” for any publicly available class. This behavior would eliminate the need for the compiler to generate dynamic dispatching for methods and properties since their implementation cannot be changed after compiletime. While the elimination of dynamic dispatch is a performance boost, this means extra care and attention will be required to turn dynamic dispatch back on for those who want consumers to override the functionality of of
Continue reading →