xmlgraphics-fop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter B. West" <pbw...@powerup.com.au>
Subject Re: FOP Style Guide (update)
Date Wed, 08 Jan 2003 16:41:36 GMT
Arnd Bei├čner wrote:
> Jeremias Maerki wrote:
> 
>>The following should (sorry, could) be ok:
>>
>>   for (int i = 0; i < 5; i++) {
>>       doSomething();
>>       if (amIRight()) cool();
>>       doSomethingElse();
>>   }
> 
> 
> One point here:
> If it's not amIRight() but
> 
> if (amIRight() || ( more stuff follows .............) cool();
> doSomethingElse();
> 
> you tend to ignore the cool() stuff in favor of doSomethingElse.

Yep.  It takes an eye for layout, which seems appropriate.

> I can't count the times I've seen people hunt for this kind of
> bug (most when changing someone else's code, of course).
> 
> Which is why I always use:
> 
> if (foo)
>   doFoo();
> 
> On the whole I think you would be served best by forbidding
> 
> if (foo) doFoo();
> 
> and allowing
> 
> if (foo)
>   doFoo();
> else
>   doBar();
> 
> as well as
> 
> if (foo) {
>   doFoo();
> } 
> else {
>   doBar();
> }
> 
> leaving this issue to personal taste.

This man must be one of them there anarchists.

> Just my 2 cents.

Peter
-- 
Peter B. West  pbwest@powerup.com.au  http://www.powerup.com.au/~pbwest/
"Lord, to whom shall we go?"


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Mime
View raw message