2010/12/5 William Tanksley, Jr <wtanksle...@gmail.com>
> Jude <bookofj...@gmail.com> wrote:
> > I don't like this. Surrounding it with parentheses makes it stand out
> > better, regardless of whether or not it's short, long, or multi-line.
>
> Could you explain why? Using parentheses makes it look like a function
> call instead of a statement. Nobody's going to DIE because of that
> :-), but I don't understand the justification that it "makes it stand
> out", when all projects I've been on said the opposite.
>
> I think I'd better add that I can't afford to argue here... I've
> written a lot of code, but none for Crawl. It would be better to set
> ANY standard than none, and it's more important to avoid widespread
> changes than to pick a perfect standard that changes a ton of things.
>
> > -Jude
>
> -Wm
>
I agree that it looks like a function call, thus my proposal. Here is
another one:
put the return expression in parenthesis only if it contains an operator. If
it is just a single word, value or function call, parenthesis aren't needed.
Examples:
return 0;
return variable_name;
return true;
return function_call(parm);
return (a + b);
return (foo == ENUM_FOO || bar == ENUM_bar);
------------------------------------------------------------------------------
What happens now with your Lotus Notes apps - do you make another costly
upgrade, or settle for being marooned without product support? Time to move
off Lotus Notes and onto the cloud with Force.com, apps are easier to build,
use, and manage than apps on traditional platforms. Sign up for the Lotus
Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d
_______________________________________________
Crawl-ref-discuss mailing list
Crawl-ref-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/crawl-ref-discuss