Re: IF or SWITCH

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

 



On Thu, 2006-04-06 at 09:08, John Wells wrote:
> > ...Either way,
> > internally, switch behaves like if/elseif/else and generally only
> > provides an advantage with respect to code organization or if you want a
> > particular condition to drop through to other case blocks.
> >
> 
> Considering this is regarding an if/else with ***57*** conditional
> checks, wouldn't we be wise in suggesting switch/case if one of its
> benefits is code organization and readability?

No! Due to the complexity of the conditionals in question nothing but an
extra indentation level would be gained by using switch semantics.

> Imagine having to come back to this code block in a months time to trace a bug.
> 
> *shudder*

Comments are a tool, and should be used as such. Syntax highlighting can
make the experience much easier to swallow since your comments should
stand out if written clearly and concisely.

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

-- 
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