Re: Little question about switch CS

From: Date: Sat, 15 Jan 2005 08:30:03 +0000
Subject: Re: Little question about switch CS
References: 1 2 3 4  Groups: php.pear.qa 
Request: Send a blank email to pear-qa+get-2334@lists.php.net to get a copy of this message
Sean Coates wrote:
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;
... }
<snip> Personally, I find that the next "case *:" tells me where the previous block ended or the closing brace. I prefer switch (foo) {
    case 1:
        action1;
        break;
    case 2:
        action2;
        break;
} This means its easier to see the list of case conditions, and I don't need to mentally block out the "break;"'s Still, its very trivial, I think we shouldn't force the user either way on this point, except to that it should be one or the other. - Davey

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