Re: Wrapping long if statements

From: Date: Mon, 15 Nov 2004 10:37:19 +0000
Subject: Re: Wrapping long if statements
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-34394@lists.php.net to get a copy of this message
On Mon, 2004-11-15 at 10:10, Nicolas Hoizey wrote: > Hi, > > > I think if you wrap it to something like this it makes it a lot less > > readable since the indention of the conditions are the same as the > > statements to within the if-statement, i.e.: > > > > if (($a == 0) and ($b == 0) and ($c == 0) and > > ($d == 0) and ($e == 0)) { > > // do something > > } > > I usualy add one indentation to the conditions, like in the folowing: > > if (($a == 0) and ($b == 0) and ($c == 0) and > ($d == 0) and ($e == 0)) { > // do something > } > if (($a == 0) and ($b == 0) and ($c == 0) and ($d == 0) and ($e == 0)) { // do something } IMHO this is more readable, \n before the { just because of the long statement. > > -Nicolas > > -- > Nicolas "Brush" HOIZEY > > Clever Age : http://www.clever-age.com/ > Gastero Prod : http://www.gasteroprod.com/ > phpMyChat : http://phpmychat.sf.net/

« previous php.pear.dev (#34394) next »