3 ms·
> *Reusability*: Here's where Clojure really shines. Because most functions are pure and operate on few common data structures (mostly maps, vectors and sets) i
by simongray 5y ago
> *Reusability*: Here's where Clojure really shines. Because most functions are pure and operate on few common data structures (mostly maps, vectors and sets) it is very easy to write reusable code. We created many internal libraries just by separating the candidate functions into their own namespaces within the regular project source tree. To finally establish the library we move the code from the project repo into a new Git repo and include the resulting library Jar in the project.clj as dependency. Thus, we have a very lean process that results in production-quality resusable assets.
This is very true. Data-orientation really helps with reuse and library composibility.
The ability to reference git repos in the deps.edn file further supports this process. I don't particularly like the ergonomics of the Clojure CLI, though, but having this feature is pretty great. I use it all the time.