Re: Properties: A question of style

2016-06-15 Thread dangerwillrobinsondanger
"What's New in Cocoa" Sent from my iPhone > On Jun 16, 2016, at 9:49 AM, Jeff Szuhay wrote: > > Tuesday? > Any close approximation of the title of his talk would be helpful. > >> On Jun 15, 2016, at 4:47 PM, dangerwillrobinsondan...@gmail.com wrote: >> >> Watch the Ali Ozer video from the ot

Re: Properties: A question of style

2016-06-15 Thread Jeff Szuhay
Tuesday? Any close approximation of the title of his talk would be helpful. > On Jun 15, 2016, at 4:47 PM, dangerwillrobinsondan...@gmail.com wrote: > > Watch the Ali Ozer video from the other day at wwdc. > He covers this very topic. ___ Cocoa-dev

Re: Properties: A question of style

2016-06-15 Thread Quincey Morris
On Jun 15, 2016, at 16:34 , Graham Cox wrote: > > If the property is ‘isFoo’, then in every situation (such as KVO, or using > dot syntax) I would be using the keypath “isFoo”, and that’s fine, but it’s > inconsistent with other properties that are not readonly, where the > underlying property

Re: Properties: A question of style

2016-06-15 Thread dangerwillrobinsondanger
Watch the Ali Ozer video from the other day at wwdc. He covers this very topic. Sent from my iPhone > On Jun 16, 2016, at 8:34 AM, Graham Cox wrote: > > >> On 16 Jun 2016, at 3:45 AM, Jens Alfke wrote: >> >> >>> On Jun 14, 2016, at 4:48 PM, Graham Cox wrote: >>> >>> @property (readonly)

Re: Properties: A question of style

2016-06-15 Thread Graham Cox
> On 16 Jun 2016, at 3:45 AM, Jens Alfke wrote: > > >> On Jun 14, 2016, at 4:48 PM, Graham Cox wrote: >> >> @property (readonly) BOOL isFoo; >> >> or: >> >> @property (readonly, getter=isFoo) BOOL foo; > > Are you asking whether it’s better to name a boolean property “foo” or > “isFo

Re: Properties: A question of style

2016-06-15 Thread Charles Srstka
> On Jun 14, 2016, at 8:42 PM, Steve Mills wrote: > >> On Jun 14, 2016, at 19:45, Charles Srstka > > wrote: >> >> if thisArray.empty { doSomething() } > > That's not what he suggested as the 2nd form. Look again. > > Steve via iPad Except that it is. The prope

Re: Properties: A question of style

2016-06-15 Thread Jens Alfke
> On Jun 14, 2016, at 4:48 PM, Graham Cox wrote: > > @property (readonly) BOOL isFoo; > > or: > > @property (readonly, getter=isFoo) BOOL foo; Are you asking whether it’s better to name a boolean property “foo” or “isFoo”? Or are you asking about the naming of the getter method for a no

Re: Properties: A question of style

2016-06-15 Thread Michael Starke
If I've though longer about my answer I would have seen that you only talk about read-only properties, I could have saved the comment. It's only useful for readwrite properties, because only then the asymmetric getter/setter situations can occur. > >> >> Hi all, >> >> Just a quick point for

Re: Properties: A question of style

2016-06-14 Thread Michael Starke
> On 15.06.2016, at 01:48, Graham Cox wrote: > > Hi all, > > Just a quick point for discussion. > > Suppose I have a read-only BOOL property. What’s better, to declare it as: > > @property (readonly) BOOL isFoo; > > or: > > @property (readonly, getter=isFoo) BOOLfoo; > > > Is there a

Re: Properties: A question of style

2016-06-14 Thread Quincey Morris
On Jun 14, 2016, at 18:55 , Steve Mills wrote: > > Why are you using a getter as a setter? I’m not. I’m saying, as far as I’m concerned, the property is “isAnimal”, not “animal”. (Obviously, in the case of an existing property for an existing class, I have to use whatever forms the class dec

Re: Properties: A question of style

2016-06-14 Thread Steve Mills
> On Jun 14, 2016, at 20:51, Quincey Morris > wrote: > > FWIW, I prefer to use the other form for setters, too. I don’t see why: > >self.animal = YES; > > is any improvement over: > >self.isAnimal = YES; > > even when it’s something less concrete, say: > >self.enabled = YES; >

Re: Properties: A question of style

2016-06-14 Thread Quincey Morris
On Jun 14, 2016, at 16:48 , Graham Cox wrote: > > n.b. I’d always use the latter form for read/write properties FWIW, I prefer to use the other form for setters, too. I don’t see why: self.animal = YES; is any improvement over: self.isAnimal = YES; even when it’s something le

Re: Properties: A question of style

2016-06-14 Thread Steve Mills
> On Jun 14, 2016, at 19:45, Charles Srstka wrote: > > if thisArray.empty { doSomething() } That's not what he suggested as the 2nd form. Look again. Steve via iPad ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin req

Re: Properties: A question of style

2016-06-14 Thread Charles Srstka
> On Jun 14, 2016, at 6:48 PM, Graham Cox wrote: > > Hi all, > > Just a quick point for discussion. > > Suppose I have a read-only BOOL property. What’s better, to declare it as: > > @property (readonly) BOOL isFoo; > > or: > > @property (readonly, getter=isFoo) BOOL foo; > > > Is th

Properties: A question of style

2016-06-14 Thread Graham Cox
Hi all, Just a quick point for discussion. Suppose I have a read-only BOOL property. What’s better, to declare it as: @property (readonly) BOOL isFoo; or: @property (readonly, getter=isFoo) BOOL foo; Is there any advantage to one over the other? n.b. I’d always use the latter form for read/