RE: Re: Function size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Paul,
> 
> Are you stating here that compression is a bad thing?
> 
> That means you consider this nice:
> 
> if ( action == A )
> {
>     doA();
> }
> else if (action == B )
> {
>     doB();
> }
> else
> {
>     doC();
> }
> 
> Or perhaps flooded with comments that merely say the same as the code does?
> 
> I'd go for
> if(action == A)
>     doA();
> else if(action == B)
>     doB();
> else
>     doC();
> 
> or , if it's really that clean, i'd probably go for if(action == A)  doA();
> else if(action == B)  doB(); else doC();
> 
> - Matijn

How about this:

($action == 1? doA():($action == 2? doB(): doC()));



Steve.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux