Refactoring – Replace Nested Conditional with Guard Clauses

Say you’ve got multiple nested if statements. 

It’s not clear what the path of execution is.

Here’s an example with multiple nested ifs:

and without:

  }; 

http://sourcemaking.com/refactoring/replace-nested-conditional-with-guard-clauses

Leave a Reply

Your email address will not be published. Required fields are marked *