Re: release and reference counting query
Re: release and reference counting query
- Subject: Re: release and reference counting query
- From: j o a r <email@hidden>
- Date: Mon, 17 Nov 2008 10:34:01 -0800
On Nov 17, 2008, at 10:02 AM, Marc Stibane wrote:
So why the local var?
3 lines of code instead of 1...
Isn't a main goal of Cocoa to write *less* code?
If you switch mailing lists with your replies, you should probably
call that out and explain why...
The main goal for most programmers is not to write less code, it's to
write maintainable code [*]. It just so happens that a smaller body of
code often also is easier to maintain. That said, writing less code is
also an often used obfuscation technique -> You need to find the right
balance.
An argument that I've often heard in favor of the use of temporary
local variables is that it makes it easier to inspect them in the
debugger, and I think that's a pretty good point (although it doesn't
really apply in this case). Also keep in mind that in Cocoa we
strongly advocate the consistent use of accessor methods for instance
variables.
If you don't like a particular piece of sample code, I'd suggest that
you file a bug report / enhancement request here:
<http://developer.apple.com/bugreporter/>
j o a r
[*] It has to be functional too, of course, but that kind of goes
without saying...
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden