Well?
Well?
Left, of course
well? general??
if (condition)
{ foo();
bar(); }
else
{ bar();
foo(); }
left but with no space after else
I never put spaces before my braces
refactor foo & bar so their order is independent of condition
This, but to answer the question... Depends on the language. Sometimes I don't use { } at all
void *ptr = (void *)malloc(8);
>I never put spaces before my braces
I hope you get raped by a pack of niggers you piece of shit
Rightmost is preferred.
Middle one is acceptable.
Leftmost is just pure cancer.
if (condition){foo();bar();}
if (!condition){bar();foo();}
middle
Java? Left. If you do anything but left you are cancer.
if (condition) {
foo() ;
bar() ;}
else {
bar() ;
foo() ;}
follow the language/project standard
the fucking end
oops, screwed up
void (*first)() = foo;
void (*second)() = bar;
if (condition)
SWAP(first,second);
first();
second();
I never see the patrician one.
if (condition)
{
foo();
bar();
}
else
{
bar();
foo();
}
Left, always, forever. If I see other styles I reformat their code and draw an ascii dick in a comment.
The first one is the only sane way.
This. Don't be a special snowflake.
Readability is all that matters, and 3 offers the best readability of the 3.
if (condition) {
foo() ;
bar() ;}
else {
bar() ;
foo() ;}
what do you mean by that?
This.
if(condition) {
foo();
bar();
} else {
bar();
foo();
}
if (condition) { foo();
bar(); }
else { bar();
foo(); }
*this 2bh
(condition) ? (foo() && bar()) : (bar() && foo());
if (condition) foo(); else bar();
if (condition) bar(); else foo();