Re: CS discussion
| From: | Bruno Pedro | Date: | Tue, 15 Jul 2003 13:22:12 +0000 |
| Subject: | Re: CS discussion | ||
| References: | 1 2 3 | Groups: | php.pear.qa |
| Request: | Send a blank email to pear-qa+get-56@lists.php.net to get a copy of this message | ||
On Tue, 2003-07-15 at 14:06, Tobias Schlitt wrote:
> <zitiere wer="Bruno Pedro">
> > How about this:
>
> > <?php
> > if (
> > (condition1) ||
> > (condition2)
> > ) {
> > action1;
> > } elseif (
> > (condition3) &&
> > (condition4)
> > ) {
> > action2;
> > } else {
> > defaultaction;
> > }
> > ?>
>
> I think, this version is althought quite good! Even better than mine!
It might *look* better but it has a problem: the operators. The lines
should break before the operators, not after. But breaking the lines
before the operators decreases readibility:
<?php
if (
(condition1)
|| (condition2)
) {
action1;
}
?>
Regards
--
Bruno Pedro
PTM.com
Key fingerprint = B398 3A92 704F C74D A984 2424 26F0 189E 9FEE CDC8
http://search.keyserver.net:11371/pks/lookup?op=get&search=0x9FEECDC8
Attachment: [application/pgp-signature] This is a digitally signed message part signature.asc
Attachment: [application/pgp-signature] This is a digitally signed message part signature.asc