title: Common programming mistakes for Clojure developers to avoid
body: <p>What are some common mistakes made by Clojure developers, and how can we avoid them?</p>
  
  <p>For example; newcomers to Clojure think that the <code>contains?</code> function works the same as <code>java.util.Collection#contains</code>.  However, <code>contains?</code> will only work similarly when used with indexed collections like maps and sets and you're looking for a given key:</p>
  
  <pre><code>(contains? {:a 1 :b 2} :b)
  ;=&gt; true
  (contains? {:a 1 :b 2} 2)
  ;=&gt; false
  (contains? #{:a 1 :b 2} :b)
  ;=&gt; true
  </code></pre>
  
  <p>When used with numerically indexed collections (vectors, arrays) <code>contains?</code> <strong>only</strong> checks that the given element is within the valid range of indexes (zero-based):</p>
  
  <pre><code>(contains? [1 2 3 4] 4)
  ;=&gt; false
  (contains? [1 2 3 4] 0)
  ;=&gt; true
  </code></pre>
  
  <p>If given a list, <code>contains?</code> will never return true.</p>