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
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
> I do not know how come its still in such wide-spread use.
Much better dev-c++ than some positively prehistoric TurboC
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
For example: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(); }
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
>> 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.
Bah, you people just do not know how to appreciate style
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)