extract boolean checks to local variables
<p>Sometimes i extract boolean checks into local variables to achief better readability. </p>

<p>What do you think? </p>

<p>Any disadvantages? </p>

<p>Does the compiler a line-in or something if the variable isn't used anywhere else? I also thought about reducing the scope with an additional block "{}".</p>

<pre><code>if (person.getAge() &gt; MINIMUM_AGE &amp;&amp; person.getTall() &gt; MAXIMUM_SIZE &amp;&amp; person.getWeight &lt; MAXIMUM_WEIGHT) {
 // do something
}
</code></pre>

<p><hr /></p>

<pre><code>final boolean isOldEnough = person.getAge() &gt; MINIMUM_AGE;
final boolean isTallEnough = person.getTall() &gt; MAXIMUM_SIZE;
final boolean isNotToHeavy = person.getWeight &lt; MAXIMUM_WEIGHT;

if (isOldEnough &amp;&amp; isTallEnough &amp;&amp; isNotToHeavy) {
 // do something
}
</code></pre>
