Re: Constructive Criticism

2009-10-07 Thread Bill Bumgarner
On Oct 7, 2009, at 9:53 AM, Derek Chesterfield wrote: Just an aside, but does either syntax got optimised by the compiler (GCC or LLVM). Obviously it can't in all cases, but this seems an obvious case where it could be replaced by an assignment. Message sends can never be optimized away by

Re: Constructive Criticism

2009-10-07 Thread Alastair Houghton
On 7 Oct 2009, at 18:19, BJ Homer wrote: On Wed, Oct 7, 2009 at 10:53 AM, Derek Chesterfield wrote: On 6 Oct 2009, at 22:48, Alastair Houghton > wrote: Oh, and since I'm in the dot-syntax-is-evil camp, s/self.year/[self year]/g in Bill's code :-D :-D Just an aside, but does either synt

Re: Constructive Criticism

2009-10-07 Thread BJ Homer
On Wed, Oct 7, 2009 at 10:53 AM, Derek Chesterfield wrote: > > > On 6 Oct 2009, at 22:48, Alastair Houghton > wrote: > > Oh, and since I'm in the dot-syntax-is-evil camp, s/self.year/[self >> year]/g in Bill's code :-D :-D >> > > Just an aside, but does either syntax got optimised by the compil

Re: Constructive Criticism

2009-10-07 Thread Derek Chesterfield
On 6 Oct 2009, at 22:48, Alastair Houghton place.net> wrote: Oh, and since I'm in the dot-syntax-is-evil camp, s/self.year/[self year]/g in Bill's code :-D :-D Just an aside, but does either syntax got optimised by the compiler (GCC or LLVM). Obviously it can't in all cases, but this see

Re: Constructive Criticism

2009-10-07 Thread Jonathan Dann
- (id) init { if(self == [super init]){ Year = 0; orignalYear = 0; } return (self); } In addition to the other comments regarding calling super, you don't need to initialize instance variables to values like 0, 0.0, NO, nil,

Re: Constructive Criticism

2009-10-06 Thread Kyle Sluder
On Tue, Oct 6, 2009 at 3:08 PM, Mick Walker wrote: > One question: If I was to create an initializer such as the one you > suggested. Would I still need the if(self =([super init]))... in the > initializer? You *always* need to call super's initializer, check its return value, and assign it to se

Re: Constructive Criticism

2009-10-06 Thread Bill Bumgarner
On Oct 6, 2009, at 3:08 PM, Mick Walker wrote: > One question: If I was to create an initializer such as the one you > suggested. Would I still need the if(self =([super init]))... in the > initializer? Yes. ___ Cocoa-dev mailing list (Cocoa-dev@li

Re: Constructive Criticism

2009-10-06 Thread Mick Walker
Hi Dave, Thank you for you're reply. One question: If I was to create an initializer such as the one you suggested. Would I still need the if(self =([super init]))... in the initializer? Regards. On 6 Oct 2009, at 22:43, Dave Carrigan wrote: On Oct 6, 2009, at 2:26 PM, Mick Walker wrot

Re: Constructive Criticism

2009-10-06 Thread Alastair Houghton
In addition to Bill's comments, which covered most things I think... On 6 Oct 2009, at 22:26, Mick Walker wrote: int g = Year % 19; int c = Year / 100; int h = h = (c - (int)(c / 4) - (int)((8 * c + 13) / 25) + 19 * g + 15) % 30; int i = h - (int)(h / 28) * (1 - (int)(h / 28) * (i

Re: Constructive Criticism

2009-10-06 Thread Dave Carrigan
On Oct 6, 2009, at 2:26 PM, Mick Walker wrote: Hi everyone, I am currently reading through Learn Objective-C on the Mac (M Dalrymple & S Knaster). While working through the provided examples, I want to back up what I am learning by attempting to put into practice what is being demonstrat

Re: Constructive Criticism

2009-10-06 Thread Bill Bumgarner
On Oct 6, 2009, at 2:26 PM, Mick Walker wrote: > #import > @interface Easter : NSObject { > int Year; int year; > } > - (id) init; > > - (void) setYear: (int) year; @property int year; > > - (void) CalculateYear; - (void) calculateYear; > > @end > > > --- Easter.m --- > #import "Easter

Constructive Criticism

2009-10-06 Thread Mick Walker
Hi everyone, I am currently reading through Learn Objective-C on the Mac (M Dalrymple & S Knaster). While working through the provided examples, I want to back up what I am learning by attempting to put into practice what is being demonstrated to me. To this end, I would like to post some