• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: What are the limitations of Dot Syntax?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >What are the limitations of Dot Syntax? (From: Jerry Krinock <email@hidden>)
 >Re: What are the limitations of Dot Syntax? (From: glenn andreas <email@hidden>)
 >Re: What are the limitations of Dot Syntax? (From: Jerry Krinock <email@hidden>)
 >Re: What are the limitations of Dot Syntax? (From: Chris Hanson <email@hidden>)
 >Re: What are the limitations of Dot Syntax? (From: Jerry Krinock <email@hidden>)
 >Re: What are the limitations of Dot Syntax? (From: Bill Bumgarner <email@hidden>)
 >Re: What are the limitations of Dot Syntax? (From: Charles Srstka <email@hidden>)

  • Prev by Date: Re: JSON Framework
  • Next by Date: Cleanup inside a failed init method
  • Previous by thread: Re: What are the limitations of Dot Syntax?
  • Next by thread: Re: What are the limitations of Dot Syntax?
  • Index(es):
    • Date
    • Thread