IOS, programming and other thoughts
Thursday, 8 March 2012
Condition Operator
I love this neat c trick: The condition operator. It makes my code so much tidier
e.g
return(x < 3)? YES : NO;
as opposed to:
if(x < 3){
return YES;
}else{
return NO;
}
1 comment:
Dean Thomas
8 March 2012 at 11:13
In this case would return (x < 3); not work more efficiently and be easier to read?
Reply
Delete
Replies
Reply
Add comment
Load more...
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
In this case would return (x < 3); not work more efficiently and be easier to read?
ReplyDelete