xmlgraphics-fop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arnd Beißner" <arnd.beiss...@cappelino.de>
Subject Re: FOP Style Guide (update)
Date Wed, 08 Jan 2003 17:23:52 GMT
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.

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.

Just my 2 cents.
--
Cappelino Informationstechnologie GmbH
Arnd Beißner

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


Mime
View raw message