Avoid Else, Return Early (2013)
It depends! But it depends on the actual meaning of the code, so examples which use meaningless identifiers like `doStuff()` miss the distinction.<p>If the conditions are semantically symmetrical, if&#x2F;else is the right approach:<p><pre><code>     fun max(a, b) {
        if a &gt; b { a } else { b }  
     } 
</code></pre>
But is it a precondition which causes you to skip the primary logic of the function, then get it out of the way early:<p><pre><code>     fun max(a, b) {
        &#x2F;&#x2F; special case for null
        if a==null or b==null { null }
        
        if a &gt; b { a } else { b }  
     }
</code></pre>
Yeah we want to reduce indentation, but not at the cost of making the code overall harder to follow. The logic of &quot;max&quot; is much clearly expressed as a single expression with `else`.