title: Should I return TRUE / FALSE values from a C function?
body: <p>After programming in C for several years, I realized that I have been ignoring the C convention of returning zero from a function to indicate success.  The convention seems semantically wrong to me, as zero is of course false.   The problem is I like to name functions like <code>is_valid_foobar()</code>, and in order to accomodate the convention of 'false means success', I would have to be more vague...
  that is instead of:</p>
  
  <pre><code>if ( ! is_valid_foobar() ) {
      return (error);
  }
  </code></pre>
  
  <p>Other programmers write:</p>
  
  <pre><code>if ( validate_foobar() ) {
       return (error);
  }
  </code></pre>
  
  <p>And my implementation looks like:</p>
  
  <pre><code>int is_valid_foobar (int foobar ) {
       if ( foobar &lt; MAX_ALLOWED ) {
            return TRUE;
        }
        return FALSE;
  }
  </code></pre>
  
  <p>I haven't actually caught any flak for this in code reviews. So I'm thinking it's not such a terrible habit, but it is 'unconventional'. I'm curious what people think.</p>
  
  <p>I'm very careful about the choices I make for function and variable names, and a typical review comment is "the code is really clear", and further it doesn't bother me at all to have to type an extra <code>!</code> at the front of the function call. But what sayest thou, oh mighty ones of S.O?</p>