vendredi 19 août 2022

Is there a cleaner way to implement a "if in a if" statement?

Is there another way to make this:

  1. More readable; and
  2. use fewer lines of code?

This code structure just looks like it's still not complete. Is there any refactoring that can be applied to this to make it "cleaner"?

        if (someVariable){
            bool otherVariable = SomeMethod();

            if(otherVariable){
                // Do something here
            } else {
                // Do something here
            }
        } else {
            // Do something here
        }

Aucun commentaire:

Enregistrer un commentaire