title: Logical AND, OR: Is left-to-right evaluation guaranteed?
body: <p>Is left-to-right evaluation of logical operators (<code>&amp;&amp;</code> <code>||</code>) guaranteed?</p>
  
  <p>Let's say I have this:</p>
  
  <pre><code>SDL_Event event;
  
  if (SDL_PollEvent(&amp;event)) {
      if (event.type == SDL_QUIT) {
              // do stuff
      }
  }
  </code></pre>
  
  <p>Is this guaranteed to be the same as this?</p>
  
  <pre><code>SDL_Event event;
  
  if (SDL_PollEvent(&amp;event) &amp;&amp; event.type == SDL_QUIT) {
      // do stuff
  }
  </code></pre>
  
  <p>This can also be very important, let's say we have two requirements, <code>a</code> and <code>b</code>. Requirement <code>a</code> is much more likely to fail then <code>b</code>. Then it's more efficient to say <code>if (a &amp;&amp; b)</code> than <code>if (b &amp;&amp; a)</code>.</p>