Braces

Compare

if (whatever)
{
  doSomething();
}
if (another)
{
  doSomethingElse();
}
else
{
  doAThirdThing();
}

And

if (whatever)
{
  doSomething();
}
else if (another)
{
  doSomethingElse();
}
else
{
  doAThirdThing();
}

First one should be

if (whatever)
{
  doSomething();
}

if (another)
{
  doSomethingElse();
}
else
{
  doAThirdThing();
}

Now compare

if (whatever) {
  doSomething();
}
if (another) {
  doSomethingElse();
} else {
  doAThirdThing();
}

And

if (whatever) {
  doSomething();
} else if (another) {
  doSomethingElse();
} else {
  doAThirdThing();
}

Though again, should be

if (whatever) {
  doSomething();
}

if (another) {
  doSomethingElse();
} else {
  doAThirdThing();
}