Having worked on a large Obj-C codebase that began adopting Swift, there are definitely some headaches involved in Obj-C/Swift interop, and you often aren't getting many benefits of Swift unless your new code has few to no dependencies on / is not depended on by Obj-C code, unless you can refactor it into Swift.
Given how quickly it seems they've been forced to ship, I can understand not wanting to deal with these issues, or not having the time to address them.
- It was easier to hire developers
- Code was less prone to null pointer exceptions
- There were fewer assumptions when deserializing JSON into a struct/object
Not saying that it's an unsolvable problem elsewhere, it's just an anecdotal benefit we got
It's weird using Swift and realizing how much of that trouble we went through is avoided just by not using a GC'd language
```
struct Node {
var next: Node?
var prev: Node?
}var a = Node(next: nil, prev: nil)
let b = Node(next: nil, prev: a)
a.next = b
```
These two objects will persist in memory for the entire life of the app even when all reference to a and b are gone, except for their references to one another.
Reference counting is listed as a strategy to achieve garbage collection. Broadly speaking, garbage collection is the process of automatically managing the lifecycles of objects in memory, which reference counting certainly achieves.
Question for anyone who knows: what percentage of Apple's application-software programmers double as system-software/kernel programmers? Because I expect that'd color their preferences for a daily-driver language quite a bit.
The only reason I suspect that Apple is not all over Swift is that many of their programmers are the type of coders who like falling back to C when they feel they need a performance boost. Perhaps they like the message-like nature of ObjC. Dunno. I can say that I've been able to get apps to 0 fixable crashes with Swift (some crashes are system level), not something I've ever done with ObjC, let alone Java for Android.