2 ms·
Sorry but let's maybe agree to disagree? You seem to be pointing to Swift features that are very different from ObjC (as you said yourself), but are very close
by ratww 6y ago
Sorry but let's maybe agree to disagree? You seem to be pointing to Swift features that are very different from ObjC (as you said yourself), but are very close to other similar multi-paradigm languages. You asked "Why would you even add optionals to a new language if not for the necessity of Cocoa/ObjC compatibility" and I'm answering that other languages have it. It's not that Swift turned ObjC conventions into requirements: it's that in ObjC they were mere conventions, in almost every other new language similar to Swift they are already requirements.
Sure, Swift has ObjC baggage, but those two specific features would be present in any multiparadigm language launched in the same period. Check out Scala, Kotlin and even C#, for example, and you'll see lots of similarities. Swift is going exacly where other languages are converging to.
In fact, the inspiration for the ad-hoc initializer pattern in ObjC you're mentioning probably came from other contemporary languages... maybe C++ or Smalltalk. Optionals in Swift have nothing to do with ObjC: in Swift they come from functional programming tradition, nullability in ObjC is a virtue of being a superset of C. The fact they work together is a virtue of compatibility, but those two Swift features were not specifically designed to serve ObjC.
- deleted 6y ago[deleted]
- _qulr 6y agoI wrote a reply, which quoted your comment, but then you keep rewriting your comment after I already replied, and long after you posted it, so my quote of your comment wasn't even the same anymore. That's bad form. I deleted my reply. I regret engaging with people who do that.
- deleted 6y ago[deleted]
- deleted 6y ago[deleted]