Re: Which is better coding style...
| From: | Christian Reiniger | Date: | Thu, 19 Apr 2001 19:12:02 +0000 |
| Subject: | Re: Which is better coding style... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-49404@lists.php.net to get a copy of this message | ||
On Thursday 19 April 2001 19:57, you wrote:
> Which is better?
>
> function blah() {
> switch( $bob ) {
> case 1:
> return "this";
> function blah() {
> $retval = "";
>
> switch( $bob ) {
> case 1:
> $retval = "this";
> break;
> In other words, is it good practice to exit out of a block (any
> block... not just switch; if, for, while) prematurely as demon-
> strated in the first example? Or should you do it as demon-
> strated in the second example?
Well, what is more readable, understandable, clearer?
--
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)
REALITY.SYS corrupted ... reboot Universe [Y,n]?