Curly braces on their own line or not?
- by TomWij
Should curly braces be on their own line or not? What do you think about it?
if (you.hasAnswer()) {
you.postAnswer();
} else {
you.doSomething();
}
or should it be
if (you.hasAnswer())
{
you.postAnswer();
}
else
{
you.doSomething();
}
or even
if (you.hasAnswer())
you.postAnswer();
else
you.doSomething();
Please be constructive! Explain why, share experiences, back it up with facts and references... ;-)