Re: Little question about switch CS
| From: | Alan Knowles | Date: | Fri, 14 Jan 2005 06:00:52 +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-2325@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. Yeah - I brought it up, I think after someone asked me about it.. - more in relation to the fact that I've been the indentation illustrated below, and not what was in the manual. I think the conclusion was something along the lines, of not to change it, but to ignore the fact that people where adding the extra indentation. (From what I remember it was regarded as a little petty to enforce such a major change either way. )I cant remember if this was in the context of having a few 'recommended, but not essential elements to the CS section'. Regards Alan
I prefer the following for both short and long: switch (condition) {case 1: action1; break;case 2: action2; break;default: defaultaction;} Similar to the existing standard, but with the cases indented, just like every other bracketed thing in the standard. Thanks, --Dan