title: Why is testing "$?" to see if a command succeeded or not, an anti-pattern?
body: <p>I see <a href="https://stackoverflow.com/a/31195882/1421456">here</a> that testing whether $? is zero (success) or something else (failure) is an anti-pattern, but I have not been able to find this anywhere else.</p>
  
  <p>Sticking to the definition of anti-pattern of the <a href="https://en.wikipedia.org/wiki/Anti-pattern" rel="noreferrer">Wikipedia</a>: "An anti-pattern (or anti-pattern) is a common response to a recurring problem that is usually ineffective and risks being highly counterproductive." Why would this be an anti-pattern?</p>