Brace Placement
There are two major brace placement strategies that are acceptable:
- Place brace under and inline with keywords:
if (condition)
{
}
- Place the initial brace on the same line as the keyword and the trailing brace inline on its own line with the keyword:
if (condition) {
}
You can choose either of the two strategies shown above. However, you should be consistent in using one strategy and not mix them together.
if (condition)
{
}
if (condition)
{
}