Re: assignment in if clause
Re: assignment in if clause
- Subject: Re: assignment in if clause
- From: "Hamish Allan" <email@hidden>
- Date: Mon, 26 May 2008 20:38:11 +0100
On Mon, May 26, 2008 at 8:12 PM, Michael Gardner <email@hidden> wrote:
> I disagree with the whole notion that using the result of an assignment
> is "bad style" or "confusing". I find it quite clear and natural to use
> constructs like "while (foo = [enumerator nextObject])", and I suggest
> to those who are uncomfortable with the similarity of the = and ==
> operators to use an editor that makes the difference clear, perhaps via
> syntax coloring. And adding extra parentheses just to assure the
> compiler that you know what you're doing is man serving machine, not the
> other way around as it should be.
Why tinker with syntax highlighting to make the difference a bit
clearer, when the compiler you're already using already makes the
difference crystal clear?
Presumably, using debugging tools is also a case of man serving
machine -- you should just write the code properly in the first place
;)
Hamish
_______________________________________________
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