title: Does anyone disagree with the statement: "using switch is bad OOP style"?
body: <p>I have seen it written in multiple threads/comments on stackoverflow that using <code>switch</code> is just bad OOP style. Personally I disagree with this.</p>
  
  <p>There will be many cases where you cannot add code (i.e. methods) to <code>enum</code> classes you want to switch on because you don't control them, perhaps they are in a 3rd-party jar file. There will be other cases where putting the functionality <em>on the enum itself</em> is a bad idea because it violates some separation-of-concerns considerations, or it is actually a function of something else <em>as well as the enumeration</em>.</p>
  
  <p>Last of all, switches are concise and clear:</p>
  
  <pre><code>boolean investable;
  switch (customer.getCategory()) {
      case SUB_PRIME:
      case MID_PRIME:
          investible = customer.getSavingsAccount().getBalance() &gt; 1e6; break;
      case PRIME:
          investible = customer.isCeo(); break;
  }
  </code></pre>
  
  <p>I'm not defending every use of <code>switch</code> and I'm not saying it's always the way to go. But statements like "Switch is a code smell" are just wrong, in my opinion. Does anyone else agree?</p>