title: Best Practices for Robustness
body: <p>I just came across <a href="https://stackoverflow.com/questions/139686/should-local-variable-initialisation-be-mandatory#283127">this question</a> about initializing local variables.  Many of the answers debated simplicity/readability <em>vs.</em> robustness.  As a developer of (remotely deployed) embedded systems, I always favor robustness and tend to follow several seemingly conflicting rules:</p>
  
  <ul>
  <li><p>Handle every error to the best of your ability in a way that allows the device to continue running.</p></li>
  <li><p>Design the code to fail <em>as soon as possible</em> after a programming or fatal error occurs.</p></li>
  </ul>
  
  <p>We've all been trained to validate input to prevent the device from breaking as a result of user (or other external) input; always assume data may be invalid and test it accordingly.</p>
  
  <p><strong>What other <em>specific</em> practices do you follow to ensure robustness?</strong>  Examples are helpful, but I'm also interested in <em>techniques</em> that are universally applicable.</p>