[haiku-development] Re: Clarifying multi-line if-clause rule

  • From: "Jürgen Wall" <x-otic@xxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Tue, 08 Feb 2011 07:46:17 +0100

> if (some condition)
>     do_something();
> 
> Slightly better than the next since less overall clutter:
> 
> if (some condition) {
>     do_something();
> }
> 
> This next thing is undoubtly considered a multi-line if-block:
> 
> if (some condition) {
>     do_something();
>     and_something_else();
> }


My experiences so far led me to the conclusion that sooner or later
nearly every single-line if statement expands to a multi-line one.
So adding braces consequently saves time (in retrospect) and keeps the rule 
simple.

BR,
 Jürgen
-- 
NEU: FreePhone - kostenlos mobil telefonieren und surfen!                       
Jetzt informieren: http://www.gmx.net/de/go/freephone

Other related posts: