title: When to use isInstanceOf and when to use a match-case-statement (in Scala)?
body: <pre><code>sealed class A
  class B1 extends A    
  class B2 extends A
  </code></pre>
  
  <p>Assuming we have a List of objects of class <code>A</code> :
      val l: List[A] = List(new B1, new B2, new B1, new B1)</p>
  
  <p>And we want to filter out the elements of the type B1.
  Then we need a predicate and could use the following two alternatives:</p>
  
  <pre><code>l.filter(_.isInstanceOf[B1])
  </code></pre>
  
  <p>Or</p>
  
  <pre><code>l.filter(_ match {case b: B1 =&gt; true; case _ =&gt; false})
  </code></pre>
  
  <p>Personally, I like the first approach more, but I often read, one should use the <code>match-case</code> statement more often (for reasons I do not know).</p>
  
  <p>Therefore, the question is: Are there drawbacks of using <code>isInstanceOf</code> instead of the <code>match-case</code> statement ? When should one use which approach (and which approach should be used here and why) ? </p>