MySQL Lists are EOL. Please join:

List:Internals« Previous MessageNext Message »
From:Michael Widenius Date:April 6 2009 1:10pm
Subject:re: coding style change proposal: switch exception
View as plain text  
Hi!

>>>>> "Ingo" == Ingo Strüwing <Ingo.Struewing@stripped> writes:

Ingo> Hi,
Ingo> I propose to get rid of the "switch exception" regarding the opening
Ingo> brace. I propose to write new code so that the opening brace is put on
Ingo> its own line below the switch keyword.

This causes an extra indention and what is worse make the case labels
for the swith not line up with the switch statement.

As far as I remmeber, it's a very common C code style to have SWITCH
and their CASE to start at the same offset.

When you have switches inside switches the resulting code is, at least
in my eyes, much harder to read if you indent the case on extra level.

The reason to put the { on the switch line, was to avoid the 'ugly' case
where { and following case are on the same offset like in:

  switch()
  {
  case

Ingo> I suggest to indent the case labels, but this is a much smaller wish. My
Ingo> proposal shall be taken as accepted even if the indentation suggestion
Ingo> is refused.

I prefer the current exception as you get a nice lineup of switch and
case, which I think is easier to read.

Regards,
Monty
Thread
coding style change proposal: switch exceptionIngo Strüwing13 Mar
  • [style] change proposal: switch exceptionKonstantin Osipov17 Mar
    • Re: [style] change proposal: switch exceptionChad MILLER17 Mar
    • re: [style] change proposal: switch exceptionMichael Widenius6 Apr
  • re: coding style change proposal: switch exceptionMichael Widenius6 Apr
    • Re: coding style change proposal: switch exceptionMats Kindahl6 Apr
      • Re: coding style change proposal: switch exceptionMichael Widenius19 Apr
        • Re: coding style change proposal: switch exceptionIngo Strüwing20 Apr