Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualEctara

Posted 11 February 2013 - 11:17 AM

Empty loops get a pair of braces on the same line.


That's an interesting idea. I use empty braces on the same line for an empty function or class definition. My empty loops look like this:
while(*(src++) = *(dst++))

        ;

 

I guess I just feel like loop bodies should start on the next line, no matter what. I'm also strongly against semi-colon on the same line to prevent things like this:
for(;;);
{
//Why am I not executed as expected?
}


#1Ectara

Posted 11 February 2013 - 11:17 AM

Empty loops get a pair of braces on the same line.


That's an interesting idea. I use empty braces on the same line for an empty function or class definition. My empty loops look like this:
while(*(src++) = *(dst++))

        ;

 

I guess I just feel like loop bodies should start on the next line, no matter what. I'm also strongly against semi-colon on the same line to prevent things like this:
for(;;);
{
//Why am I not executed?
}


PARTNERS