4 ms·
There is no less dynamicism in swift than in objective-c. What there is, is a replacement for the C. Which is precisely what they said they were going to do.
by gress 12y ago
There is no less dynamicism in swift than in objective-c. What there is, is a replacement for the C. Which is precisely what they said they were going to do. C, of course is not dynamic, and the replacement is not either.
I'm not disputing the idea that instead of replacing the C, Swift's designers could have focussed on enhancing the message passing component, but I would argue that doing so without also replacing the C would have been a mistake.
Perhaps the dynamic elements will also be overhauled over time.
- mpweiher 12y ago>There is no less dynamicism in swift than in objective-c. Huh? "Requiring dynamic dispatch is rarely necessary." "The bad news is that, by default, your objects will no longer work with KVO or swizzling. If the designer of a class doesn’t anticipate a reason for a particular method or property to be dynamic, that lack of foresight gets baked in at compile time." etc. See http://mjtsai.com/blog/2014/08/18/its-a-coup/ http://mjtsai.com/blog/2014/08/18/its-a-coup/ If that is not correct, I'd love to hear about it! > Swift's designers could have focussed on enhancing the message passing component, That would have been great. > doing so without also replacing the C would have been a mistake. Absolutely. But really they've replaced the "Objective" and enhanced the C. After all, Objective-C is a blend of Smalltalk and C. If you remove the C, what is left? >Perhaps the dynamic elements will also be overhauled over time. Maybe. So far, that "overhaul" seems to be mostly de-emphasis, deprecation and removal. :-(
- gress 12y agoSwizzling can't be mentioned with a straight face in an argument about brittleness. But, I'll concede that KVO won't work with arbitrary properties of binary libraries you receive or that Apple builds into the platform, assuming they use swift and choose not to mark them dynamic. So in this sole regard, swift is less dynamic. I guess it remains to be seen whether this actually becomes a problem.