THE PASZ.COM BLOG

Wednesday, July 20, 2005

Coding Style: I've Finally Succumbed to Peer Pressure

I've always thought code looks more elegant and symmetrical in the old C Style, where the open curly brace has it's own line. Such as...

void main()
{
  printf("Hello world");
  if(x == true)
  {
    doSomething();
  }
  exit();
}

In the last few years, it seems like just about everyone has switched to putting the brace on the same line as the function declaration or if statement. And I'm just tired of my code sticking out. So I've finally accepted that this is the way of the world, and I've started to write my code with the open brace on the same line.

void main(){
... etc.

I{
  hope{
    you're{
        all{
            happy!{
}}}}}

4 Comments:

Post a Comment

<< Home