Re: What are the limitations of Dot Syntax?
Re: What are the limitations of Dot Syntax?
- Subject: Re: What are the limitations of Dot Syntax?
- From: Bill Bumgarner <email@hidden>
- Date: Sat, 06 Dec 2008 13:02:19 -0800
On Dec 6, 2008, at 11:15 AM, Charles Srstka wrote:
So would something which is clearly not a property, but still
returns an object, such as:
myObj = mySet.anyObject;
or:
enumerator = myArray.objectEnumerator;
be considered kosher?
If you can write that and sleep well at night, then sure... go for it.
Seriously -- there isn't a hard defined line for this.
Personally, I initially found code like the above distasteful when I
was first writing code with the dot syntax. At first, my thinking
was much more hardline "if it is a setter/getter, use dot. Otherwise,
do not.".
Over time, I have tended to write code like the above more and more
often. -anyObject and -objectEnumerator don't really act on the
target, they simply retrieve something from the target. And that is
definitely in line with the thinking behind the dot syntax.
b.bum
_______________________________________________
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