I disagree strongly with wrapping things in redundant some?/none? checks. (when thing ...) is entirely idiomatic and you should get used to reading it.
I agree that sometimes excessive comp/partial usage can be hard to read, but his example is bad:
(map (comp str/capitalize str/trim) strings)
Anyone who calls themselves competent in clojure should easily read this as "capitalize and trim the strings". This is actually a perfect use of comp. The benefit of comp/partial is that you avoid creating a new function, which creates a new reference frame and introduces a variable just to pass it along to another function.
Even as experienced Clojure programmer I haven’t developed a skill to parse such structures easily.
11
u/maestro2005 May 25 '17
I disagree strongly with wrapping things in redundant
some?/none?checks.(when thing ...)is entirely idiomatic and you should get used to reading it.I agree that sometimes excessive
comp/partialusage can be hard to read, but his example is bad:(map (comp str/capitalize str/trim) strings)Anyone who calls themselves competent in clojure should easily read this as "capitalize and trim the strings". This is actually a perfect use of
comp. The benefit ofcomp/partialis that you avoid creating a new function, which creates a new reference frame and introduces a variable just to pass it along to another function.Then you're not really that experienced.