r/Clojure • u/yogthos • May 05 '21
Six years of professional Clojure development
http://www.falkoriemenschneider.de/a__2021-05-10__Six-years-of-professional-Clojure-development.html10
u/slifin May 06 '21
Some discipline required:
there is no static type system that checks your code upon compilation
But there is a very capable static analyser that can detect mistakes in your code as you type the code: https://github.com/clj-kondo/clj-kondo, install it directly into your editor here: https://github.com/clj-kondo/clj-kondo/blob/master/doc/editor-integration.md
8
5
u/SimonGray May 06 '21
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.
2
8
May 05 '21
[removed] — view removed comment
6
u/yogthos May 06 '21
Yeah, I've been really impressed with that in Cursive. Also, stuff like letting you know if a symbol is unused, checking function arity, auto requiring stuff, etc. There are obviously some limitations on what you can do with a dynamic language, but it's surprisingly good overall.
5
u/ertucetin May 05 '21
Thank you so much for sharing this. I agree with every point you make.