title: When to use aliases and when to use :refer in Clojure/ClojureScript :require?
body: <p>When using <code>:require</code> in Clojure or ClojureScript, when should you use aliases and when should you cherry-pick only the functions you use?</p>
  
  <p>Examples:</p>
  
  <ol>
  <li><p>Using an alias</p>
  
  <pre><code>(:require [some-package.sub as some])
  
  (some/do-stuff "xyz")
  </code></pre></li>
  <li><p>Using <code>:refer</code></p>
  
  <pre><code>(:require [some-package.sub :refer [do-stuff]])
  
  (do-stuff "xyz")
  </code></pre></li>
  </ol>
  
  <p>Using an alias seems more handy if the dependency has plenty of functions you want to use or you use all of its functions (however many there are), especially since ClojureScript (intentionally) doesn't support <code>:refer :all</code>. On the other hand, using <code>:refer</code> seems like a more "clean" approach, especially when using only some specific functions from the dependency.</p>
  
  <p>Are there other things one should consider when choosing between the two (and is this a valid reason in the first place)?</p>
  
  <p>Another thing that I could think of is that if you have lots of dependencies and/or loads of your own functions defined in the file, it might be beneficial to have the alias prefixes in function calls to make it clearer where those functions are located, even if you only use a small subset of the functions offered by the dependency.</p>
  
  <p>How should I choose which one to use? Or is it something you should just decide within your dev team and everything is fine as long as you stick with one approach?</p>