On Sun, Dec 05, 2010 at 10:13:56PM +0100, Raphael Langella wrote:
> 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.
> 
> 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);

Or perhaps "if it's complex".  So a + b wouldn't hit that but a longer
expression would.


I also looked into automated formatters.  Among them, the "ansi" mode of
"astyle" matches ours pretty well, except for continuation lines.  It starts
all subsequent lines in the same column which doesn't look good.

-- 
1KB             // Microsoft corollary to Hanlon's razor:
                //      Never attribute to stupidity what can be
                //      adequately explained by malice.

------------------------------------------------------------------------------
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

Reply via email to