vendredi 22 juin 2018

Encapsulate code in if statement or use a return to stop code execution?

Which one I should use to execute code only when a condition is verified?

   if(!condition.isVerified()))
       return;

   doStuff();
   ... 

or maybe this one

 if(condition.isVerified())
 {
   doStuff();
   ... 
 }

Aucun commentaire:

Enregistrer un commentaire