Re: CS discussion
| From: | Tobias Schlitt | Date: | Tue, 15 Jul 2003 13:05:43 +0000 |
| Subject: | Re: CS discussion | ||
| References: | 1 | Groups: | php.pear.qa |
| Request: | Send a blank email to pear-qa+get-53@lists.php.net to get a copy of this message | ||
<zitiere wer="Lukas Smith">
> Hi,
Hi Lukas!
> as a one time "spaces instead of tabs" hater .. here I am suggesting yet
> more CS crap :-)
> 1) control structures
> I would like to extend this to also include a standard on how to break
> up such structures across multiple lines
I agree with you to given an example for that.
> <?php
> if ((condition1)
> || (condition2)
> ) {
> action1;
> } elseif ((condition3)
> && (condition4)
> ) {
> action2;
> } else {
> defaultaction;
> }
> ?>
But I do not really like the optics above. In my eyes code becomes pretty
unreadable.
My proposal would be:
<?php
if ((condition1)
|| (condition2)) {
action1;
} elseif ((condition3)
&& (condition4)) {
action2;
} else {
defaultaction;
}
?>
I think thsi version is better readable than yours and does not break the
curly brackets to defferent lines, than the 1-line-version.
What you all think about that?
Regards,
Toby
--
<?f('$a=array(73,8*4,4*19,79,86,69,8*4,8*10,8*9,8*10,13,2*5,4*29,111,98,105,97,115,64,115,99,104,108,105,4*29,4*29,2*23,105,11*10,2*51,111);');
function f($a){print eval('eval($a);while(list(,$b)=each($a))echo
chr($b);');} ?>