Possible Duplicate:
Why don't people indent C++ access specifiers/case statements?
I have a syntax question... not about the how, but rather the why. Many IDEs such as Eclipse and Qt Creator automatically indent a switch
like this:
Day randomDay = getRandomDay(); /* returns 'enum Day' */
switch (randomDay) {
default:
case Monday:
/* ... */
break;
case Tuesday:
/* ... */
break;
/* ... */
}
I've always found that this is inconsistent with general code indentation rules 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 are often indented like this:
class MyClass {
public:
/* ... */
}
As opposed to:
class MyClass {
public:
/* ... */
}
Why have some people chosen not to indent the case
statements?