Re: Prgramming style (was: Accessors)
Re: Prgramming style (was: Accessors)
- Subject: Re: Prgramming style (was: Accessors)
- From: Julian Barkway <email@hidden>
- Date: Thu, 8 Aug 2002 06:35:29 -0700 (PDT)
On Thursday, Aug 08, 2002, at 05:53AM, Ondra Cada <email@hidden> wrote:
>
>
Finally, I can't resist to point out that it's funny how -- at least in
>
those first four-odd follow-ups I've seen in the list already -- nicely
>
correlates style rigidness with the "I know best what's good for you"
>
attitude: we who prefer the early return say "do what suits you"; those
>
who prefer rigid style say "do what suits me"! ;))))
Well, those who dislike the early return could always do something like:
if (x == y)
goto method_end;
[y retain];
[x release];
x = y;
method_end:
return;
But that opens up a whole new can of worms!
I generally use the 'early return' for error conditions where coding an 'else' might be confusing,
eg:
rc = [foo bar];
if (rc != ok_code)
return error_code;
// do stuff
return ok_code;
--
Julian Barkway,
Zurich,
Switzerland
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.