if (simple_condition) {
} else {
}
for (long and stuffed;
expressions;
here)
{
}
if ((complicated ||
multi_line)
&& condition)
{
}
void function()
{
}
In an if, all the "else if" and "else" clauses have to follow the same style. If any is braced, they all have to be.By the way, is grandparent kidding about Go enforcing this?
The only language I can think of which enforces curly brace placement is Awk. (And only in its pattern-action pairs):
BEGIN {
function()
{
if (foo)
{
}
}
}
/regex/ { # can't move this curly to next line
action
}