[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Which ObjC2.0 features are missing in the latest GCC?

From: Andreas Fink
Subject: Re: Which ObjC2.0 features are missing in the latest GCC?
Date: Fri, 22 Nov 2019 11:20:58 +0100

> On 22 Nov 2019, at 09:08, H. Nikolaus Schaller <address@hidden> wrote:
>> Am 22.11.2019 um 08:40 schrieb David Chisnall <address@hidden>:
>> On 22 Nov 2019, at 05:31, H. Nikolaus Schaller <address@hidden> wrote:
>>> And the first thing I turn off in a
>>> new Xcode project is ARC.
>> Why?  ARC generates smaller code, faster code, and code that is more likely 
>> to be correct.
> I never had a problem with any of those three. Code correctness is rarely a 
> retain/release problem but the algorithm.
> So it solves only a small percentage of the coding problems I do face.

Then you have not done any big projects.

Even though my code is well designed in terms of ownership of objects, I still 
managed to every once in a while shoot myself into the foot and have to track 
down memory leaks forever or random crashes.
Switching to ARC made all these problems go away. No more use after free, no 
more keeping objects around after no one uses it anymore etc.
You don't have to think of releasing stuff if you are in the middle of a long 
routine and throw an exception or call return.

This is a major advantage of Objc2.0. 
I must admit it took me a while to get used to though. But at the end it paid 
off a lot.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]