2 ms·
Nope. I still found many ways to crash my objective C apps while using ARC. Because Swift is memory safe I no longer have to give up days or weeks of my life tr
by valuearb 8y ago
Nope. I still found many ways to crash my objective C apps while using ARC. Because Swift is memory safe I no longer have to give up days or weeks of my life tracking down obscure bugs caused by overwriting memory I should not have.
- blub 8y agoThanks for having the patience to put all these Obj-C myths to rest. The Obj-C community (or what's left of it) is trying to make a martyr of an error-prone, cumbersome programming language.
- gurkendoktor 8y agoCould you please give some concrete examples of how memory corruption has affected you in modern Objective-C? NSArray has range checks, delegates can't dangle anymore because they're weak references now. I think that leaves interaction with C APIs, but don't Swift users have to deal with UnsafeMutablePointer to use them - which isn't memory safe either?
- jakobegger 8y agoThe easiest way to cause memory issues is to access mutable collections from multiple threads. I really wish NSMutableArray and friends were thread safe... Unfortunately, Swift doesn't fix that AFAIK.
- lerno 8y agoNo no no. That is a one-way trip to hell. There is no ”good for all threading scenarios” thread safe mutable array design. I’ve debugged too much java code where the programmers thought that ”thread-safe” meant ”no need to think about threading issues”.