Calendar

February 2004
S M T W T F S
« Jan   Mar »
1234567
891011121314
15161718192021
22232425262728
29  

February 13, 2004

Braces Controversy

Posted by tvor @ 9:19 am

Attention coders!

In the past few days there has been much controversy stirring up here on Bamburgh Circle regarding the proper use of braces while programming.

Ever since I can remember, whenever I use braces, I always leave the opening brace on the same line:

for(int i = 0; i < 10; i++) {
     //do something
}

However, some people insist on bringing the opening brace down to it’s own line:

for(int i = 0; i < 10; i++)
{
     //do something
}

So, my question to you other programmers who read this: Which style do you prefer?

Personally, I find leaving the opening brace on the same line makes the code look nicer. The main opposing argument is that bringing the brace to it’s own line allows the programmer to see what’s inclosed in the given block. But I figure that if you are using a good enough IDE, this shouldn’t cause too much of a problem.

Oh yeah, Happy Friday the 13th!

• • •
Powered by: WordPress | Valid XHTML | CSS | RSS Feed