lundi 27 mars 2017

nested if vs. and condition

What is the most performant choice between :

if(myConditionA){
    if (myConditionB){
        if (myConditionC){
            //do something
        }
    }
}

and

if(myConditionA && myConditionB && myConditionC){
    //do something
}

What is the best choice and why ? Does it depends on the langage ? It's not a question about code quality.

Aucun commentaire:

Enregistrer un commentaire