Re: C question for you old guys ;-)
Re: C question for you old guys ;-)
- Subject: Re: C question for you old guys ;-)
- From: Daniel Hedrick <email@hidden>
- Date: Sun, 8 Jun 2003 22:48:39 -0500
On Sunday, June 8, 2003, at 08:03 PM, Daryn wrote:
On Sunday, June 8, 2003, at 07:18 PM, Gregory Weston wrote:
On 6/8/03 at 3:09 PM, Marcel Weiher wrote:
I've made it a habit ( "coding standard", if you will) to always use
{}
for if, while, for, etc.
I'll second Marcel's implied recommendation. In fact, I _did_ make it
a standard
in my shop. It's good to be the chief. Or at least the shaman.
While I agree, the recommendation is a non sequitur. These both
compile the same, and suffer from the same mistake:
if(spriteInfo == NULL); return nil;
if(spriteInfo == NULL); { return nil; }
Your statement is factually true, but perhaps not so, psychologically.
From a visual perspective, the second line screams out at any developer
-- seeing a semi-colon followed by a brace is very unusual. A
close-paren followed immediately by a semi-colon is a common occurance
-- which is why it's easy for the eye to pass over it, even if it's out
of place (as in the first case).
-daniel
email@hidden
--
Taken from a visitor parking permit at
White Sands Missile Range Museum:
"...significant areas of the Range are known
to be contaminated with unexploded ordinance."
_______________________________________________
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.