Why doesn't the case argument exist in some IDEs?

Possible duplicate:
Why don't people set C ++ access specifiers / arguments?

I have a syntax question ... not about how, but rather about why. Many IDEs, such as Eclipse and Qt Creator, automatically fall back switchas follows:

Day randomDay = getRandomDay(); /* returns 'enum Day' */

switch (randomDay) {
default:
case Monday:
  /* ... */
  break;
case Tuesday:
  /* ... */
  break;
/* ... */
}

I have always found that this is against the indentation rules of common code, and I prefer to do this:

Day randomDay = getRandomDay(); /* returns 'enum Day' */

switch (randomDay) {
  default:
  case Monday:
    /* ... */
    break;
  case Tuesday:
    /* ... */
    break;
  /* ... */
}

Similarly, C ++ class definitions often fall back like this:

class MyClass {
public:
  /* ... */
}

Unlike:

class MyClass {
  public:
    /* ... */
}

Why did some people choose not indentation in expressions case?

+5
source share
3 answers

. , .

. , , , IDE. IDE .

, , , , - .

+10

. , , .

IDE , "" . , .

, , !

+1

Eclipse , . K & R, .

There is a very reasonable explanation for each style choice, Stroustrup also addresses this in his C ++ frequently asked questions . And it doesn’t matter - "do what feels good" (within reason).

0
source

All Articles