I am starting to prefer
[/code]Code:#ifdef USE_DEBUGGER
# if x
# if y
# define L 2
# else
# define L 3
# endif
# else
Ok well you get the idea
Printable View
I am starting to prefer
[/code]Code:#ifdef USE_DEBUGGER
# if x
# if y
# define L 2
# else
# define L 3
# endif
# else
Ok well you get the idea
Yeah, that works too, but again... manual indentation.
> I do not know how come its still in such wide-spread use.
Much better dev-c++ than some positively prehistoric TurboC ;)
For example:Quote:
Originally Posted by Elysia
I do not see it necessary to indent those function calls one more level when the if/else chain is converted to a switch, unless I want to introduce a block for local scope.Code:if (x == 0)
{
foo();
}
else if (x == 1)
{
bar();
}
else
{
baz();
}
switch (x)
{
case 0:
foo();
break;
case 1:
bar();
break;
default:
baz();
}
>> Much better dev-c++ than some positively prehistoric TurboC
True, I do see occassional usage of some ancient compilers. Or even reaaaaaaaally old versions of gcc.
To laserlight: I personally just don't like how it looks. And like most programmers I am very obsessive about these things.
Same here, and it would seem very weird and/or messed up if you did introduce local scopes in those cases, as you did mention.
Perhaps it's because I see those "case" as code, clearly belonging inside the actual scope of the switch.
I also like local scopes with cases, and generally, I put the break inside the scope.
That is another thing. When you do introduce local scope to a case statement it usually reverts it back to retardo indentation.
Oh yes, I remember that adding the colon (:) after the case will revert it to its original position in the switch. That's retarded.
Bah, you people just do not know how to appreciate style :p
I never claimed that I did ;)