When I first started using braces I put the braces on the next line, kind of like a begin and end block statements (from Pascal? Basic? I forget) Examples seemed to use it and I think its the default for Resharper if you tell it to autoformat the page. Not sure what VS does without Resharper by default.
Some years ago my new work place coding standard was to put the opening brace at the end of the line. For about a week, it did my head in. After that I preferred it. Now my current project is back to the opening brace on next line. I also don't care which it is, as long as its the same through all of the project/solution. I think consistent is more important then one way over the other. This likely applies to all coding standards. It reminds me of a Garfield comic where Garfield is being nice to everyone and quite quickly they have him in a straight jacket. He thinks to himself "People don't want nice, they want consistent." On Thu, Jun 28, 2012 at 3:50 PM, Greg Keogh <[email protected]> wrote: > When I started PC coding 20 years ago on C and C++ there the convention > about where to put your {braces} was unclear. I remember back then that > there seemed to be more Microsoft sample code with vertically aligned > braces, so I ran with that and I have been ever since, even in my Java days. > I can’t recall ever having a debate with previous colleagues about which > style to use, so in the absence of any memorable disputes I’m guessing we > all used vertical braces. > > > > However, I notice a strong trend towards indented braces over the last > couple of years. The Framework Design Guidelines book also authoritatively > states that indented braces are now recommended. So am I caught on the > losing side of a braces battle? > > > > It may seem trivial, but your eyes and brain get used to a certain > appearance of code (like the VB vs C# battle) and a subtle change takes a > bit of getting use to. Are my millions of existing lines of C# code with > vertical braces now a testament to my defeat? Is anyone else suffering from > a project with mixed brace styles? > > > > Greg
