Re: IF or SWITCH (asinine?)
| From: | Ray Hauge | Date: | Fri, 07 Apr 2006 18:07:13 +0000 |
| Subject: | Re: IF or SWITCH (asinine?) | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-233458@lists.php.net to get a copy of this message | ||
On Friday 07 April 2006 08:57, tedd wrote:
>
> Personally, as I said before, I use if/else for two conditions and
> switch for three or more. Your mileage may vary, but it's truly a
> matter of choice and is not one of asinine methodology.
>
> Thanks to all who replied.
>
> tedd
>
> --
> ---------------------------------------------------------------------------
>----- http://sperling.com
I think that's a fairly good methodology to follow. I usually do that...
except when I run into a huge list of multiple conditions for each
possibility (TRUE && FALSE OR FALSE && TRUE) etc. To me IF/ELSEIF is easier
to ready in that case, and SWITCH is a LOT easier to read if you have one
variable and have a CASE for each possibility of that variable. Just my
opinion of course :)
I guess when it came down to it I just had to stick with what works for me. I
cleaned up a lot of the totals and counting, so it's MUCH easier to read
now :)
To imitate Tedd...
Thanks to all who replied
--
Ray Hauge
Programmer/Systems Administrator
American Student Loan Services
www.americanstudentloan.com
1.800.575.1099