mardi 2 février 2016

Pro/contra of using "else" if the then-clause exits the method anyways

Which of these two is the "better" method and why?

if(list.isEmpty()) {
    return;
} else {
    [...]
}

vs.

if(list.isEmpty()) {
    return;
}

[...]

Aucun commentaire:

Enregistrer un commentaire