3 ms·
That was what drove me away from Clojure in the end. It's fun to write, but a challenge to write in such a way that you can read it later without jumping all ov
by tel 13y ago
That was what drove me away from Clojure in the end. It's fun to write, but a challenge to write in such a way that you can read it later without jumping all over the place.
- cryptolect 13y agoHow big/complex were your functions? Have you seen the style guide? It's easy to write really powerful, nested functions in Clojure, which are damn hard to read the next morning. Taking advantage of thread-first and thread-last macros can really help here. I've finally started to use them heavily. For instance, you could do the following to read a file, parse it from json, and retrieve somekey: (:somekey (cheshire/parse-string (slurp "/tmp/somefile.json") true) Or (-> "/tmp/somefile.json" (slurp) (cheshire/parse-string true) (get :somekey)) In other words, there's much nicer ways to write maintainable, readable code that you can still understand in the morning. Your "jumping around" comment also makes me wonder how you were laying out your functions? My advice is to go through the libraries of the popular Clojure libraries, you will discover a lot of good practices. It's taken me a few months of Clojure to start writing cleaner, readable code.
- airfoil 13y agoI had the exact opposite experience. I found that I was laser focused on a particular chunk of code when working in Clojure. Functions were logically grouped together. I never found myself jumping around.