I suspect that what went on is that Swift was like a little internal skunkworks project. Apple compiler engineer(s) made it as an experiment or for something like their company yearly performance goals or something. The team took it, kept building on it and playing around with it to suit this environment (which didn't need to consider Cocoa at all) and it just morphed into their new language. They later tacked some interoperability with Objective-C on when it was decided that it was needed in order to ship it as a language useful to Apple devs.
My imagining of it, at least.
Yep!
Agreed 100%.
It's more than just public/private and subclassing/inheritance. Object-Oriented Programming is more about object design patterns than anything else. Take NSNotificationCenter... that is a design pattern known as "pub-sub" or "observer." Delegation like you see in UITableView and NSTableView, another design pattern. Protocols (interfaces in other languages like Java and C#), yet another design pattern. MVC, MVVM, MVC-N, singleton, class-clusters... the list goes on. There's got to be like 20-30 well-known patterns by now.
Cocoa is just like, all design patterns. If you are a Cocoa programmer, or interested, check this book out:
https://www.amazon.com/Cocoa-Design...9156731&sr=8-1&keywords=cocoa+design+patterns
(I read most of that book, it's pretty good.)
In languages like C++ with a true, static typing system, object design patterns are needed in order to achieve decoupling and abstraction, and to let you work around the typing system.
Swift takes the static route (academic), like C++. Objective-C took the dynamic route (pragmatic) like Python and JavaScript. People on this thread (and others) and blogs have been arguing about this since Swift's release... whether Swift is more academic than pragmatic and useful.
Slightly off topic, there was a recent (big) blowout about the Swift static typing system and older programmers remembering the "bad old days" were they had to route click events through switch statements and debating back and forth on this issue. And even more recently was the whole "sealed class" thing I posted about above.
Agreed. We have traded one set of problems for another. I think at this point, the only thing that can be argued is which set of problems is easier to deal with.