Re: Fast Enumeration and temporary objects/autoreleasing
Re: Fast Enumeration and temporary objects/autoreleasing
- Subject: Re: Fast Enumeration and temporary objects/autoreleasing
- From: Graham Cox <email@hidden>
- Date: Tue, 17 Apr 2012 17:09:15 +1000
On 17/04/2012, at 4:08 PM, Dave Zarzycki wrote:
> ARC simply automates and enforces Cocoa conventions. No more, no less. Therefore those "arcane use-cases" are in fact where programmers get themselves into really subtle trouble with manual reference counting.
Notwithstanding that programmers evidently do get themselves into trouble with manual ref counting, it doesn't alter the fact that actually, the rules are simple. If they were not consistent and logical, it would presumably be very difficult to have something like ARC built into the compiler. I accept that there is a documentational or intent-expressing benefit to ARC that is absent or voluntary with manual ref counting, but in terms of learning either system, ARC is harder to learn than the problem it solves. In my opinion.
It also does not eliminate the ned to understand manual ref counting since for debugging purposes you still need to understand object lifetimes whether you used ARC to manage it or did it yourself. The less "magic" the better in terms of understanding what code is doing, so again, you may as well learn to use manual ref counting. If there is a time saving benefit to ARC once you "get it", I'm all for it. But as well as, not instead of.
--Graham
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden