In Clojure, Is it idiomatically correct to use require ... as rather than use... in the ns macro

clojure, namespaces

Solution

Yes. The second form is the prefered approach.

There is some discussion related here

Problem

I'm writing a clojure application which is growing from small to medium sized. We're currently importing modules using ``` (ns foo (:use bar)) (fn-in-bar) ``` but I think that switching to ``` (ns foo (:require [bar :as b])) (b/fn-in-bar) ``` would help with clarity and code comprehension. Is this a good way to do things? Is there a better way?

Original source