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.
You're talking about Nikita Prokopov, author of (among other things) datascript and rum. If he doesn't qualify as "experienced", I don't know who does.
He's not struggling with really basic FP concepts. He just disagrees with you (and with me) concerning when using some of them helps vs hinders readability. And he is definitely not inexperienced.
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.