IMHO, I like the second. Too much real-code time to break old
habits. I don't like returning mid-method. I -really- don't like it. =)
As for the placement of braces...I like
/* return type */ function PhpFunction(params)
{
}
I'm usually not too worried about whitespace, either, so I'm all about
if (true)
{
do_something();
}
else
{
do_something_else();
}
Whitespace, IMHO, LOOKS less efficient but has the advantage of
being easier to follow/read/debug. Also more space to put in debugging
snippets
in lieu of having a real interactive debugger with a stack trace. And I've
got LOTS
of diskspace.... =)
function foo($varArray){foreach($varArray as $element){echo "this is
'tighter'\n";echo "but is it really worth it?\";} if (sizeof($varArray) ==
1){echo "1 element";}else{echo sizeof($varArray);} echo "Know what I mean,
Vern?";}
-Szii
----- Original Message -----
From: Chris Lee <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, April 19, 2001 3:51 PM
Subject: Re: [PHP] Which is better coding style...
> I would like to see an editor with a built in code beutifier and
un-beutifier. I like the
>
> if (true)
> {
>
> } else
> {
>
> }
>
> method, but pear standards are
>
> if (true) {
>
> } else {
>
> }
>
> it would be nice to see ultra edit convert it to the first format for me
and save it as the second for pear.
>
>
> --
>
> Chris Lee
> [EMAIL PROTECTED]
>
>
>
> "Philip Olson" <[EMAIL PROTECTED]> wrote in message
Pine.BSF.4.10.10104192119590.43248-100000@localhost">news:Pine.BSF.4.10.10104192119590.43248-100000@localhost...
>
> coding style? here's what pear has to say :
>
> http://www.php.net/manual/en/pear.standards.php
> http://www.php.net/manual/en/pear.standards.control.php
>
> [ example ]
>
> switch (condition) {
> case 1:
> action1;
> break;
>
> case 2:
> action2;
> break;
>
> default:
> defaultaction;
> break;
>
> }
>
> [ /example ]
>
>
> variables can be very useful.
> return is cool too.
>
> :)
>
> regards,
> philip
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]