Re: Little question about switch CS

From: Date: Fri, 14 Jan 2005 14:46:37 +0000
Subject: Re: Little question about switch CS
References: 1 2 3  Groups: php.pear.qa 
Request: Send a blank email to pear-qa+get-2328@lists.php.net to get a copy of this message
Daniel Convissor wrote:
On Thu, Jan 13, 2005 at 05:19:54PM +0000, Helgi ?ormar wrote: The switch statement section is definitely the most common "let's revise the standard" thread. There was one back in early '04, if I remember correctly. I prefer the following for both short and long:
FWIW, I think that the break should be in-line with the case, as in: switch (foo) {
    case 1:
        action1;
    break;
... } Why? For exactly the same reasons we do this: if (foo == 1) {
    action1;
} and not: if (foo == 1) {
    action1;
    }
(easier to see where a block begins and ends) S

« previous php.pear.qa (#2328) next »