title: C/C++ conditional return statements
body: <p>I am working on embedded program and in certain cases if a condition is not meant, I would like to return from function as quickly as possible.  if I have the following code and I am doing embedded programming:</p>
  
  <pre><code>foo() {
     if (a &lt; b) {
         return 0;  // bail, since condition is met
     } else {
         // lots of calculations in this block
     }
     return 1;
  }
  </code></pre>
  
  <p>My question is, is it bad having multiple return statements?  Is it bad practice?  Are there better methods?  Does MISRA say anything about it?</p>
  
  <p>NOTE:  This question is particular to Embedded Systems, has to do with MISRA not just C/C++</p>
  
  <p>Thanks...</p>