Search code examples
curly-braces

Does bracket placement affect readability?


Possible Duplicates:
Formatting of if Statements
Is there a best coding style for identations (same line, next line)?
Best way to code stackoverflow style 'questions' / 'tags' rollover buttons

public void Method {

}

or

public void Method
{

}

Besides personal preference is there any benefit of one style over another? I used to swear by the second method though now use the first style for work and personal projects.

By readability I mean imagine code in those methods - if/else etc...


Solution

  • I think it is completely subjective, however, I think it is important to establish code standards for your team and have everyone use the same style. That being said I like the second one (and have made my team use it) because it seems easier to read when it is not your code.