[swift-evolution] Static Dispatch Pitfalls

Fabian Ehrentraud Fabian.Ehrentraud at willhaben.at
Fri May 20 14:51:51 CDT 2016


Sorry, I understand and appreciate your pragmatism. Right now it feels
very much like a fight to the ideological death between POP and OOP
and it may get really bad results this way.

Being in the run-up to WWDC, I don't really have the time to participate
in this discussion right now, although I think it is important and
interesting.  However, this last sentence caught my eye and I thought I
should clarify something: protocols unify static and dynamic dispatch,
and one is not inherently better than the other.  They have different
strengths.  Protocol-oriented programming is about leveraging those
strengths appropriately, not about a mandate to choose one or the other
form of dispatch.

Well said.
Maybe the issue is not about being unclear at the point of definition in the extension, but at the call site - similar to value vs. reference semantics.
Just as a thought experiment, putting aside that it would be ugly, would having a different syntax for invoking methods with static and dynamic dispatch help to understand the working of the code better?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160520/4fc99273/attachment.html>


More information about the swift-evolution mailing list