by kzhahou · 11y ago · 0 comments
I was gonna post the question "Why should I learn clojure?" but that's easy to google for and get good articles.
I was then gonna post "What's a good book for learning Clojure?" but I can get that on Quora.
So my real question is: what can I read about Clojure that will get me up to speed on its unique awesomeness? I don't need a tutorial that shows me how to add two ints or invoke a function. Show me the good stuff!
The destructuring mechanisms in Clojure are very, very powerful. For some reason this author does not seem to like them, even though they reduce his 7 line CL program to a 2 line Clojure program. That's not a fluke, from what I've seen. Stuff that would require a lot of caddars and cddaars and whatnot in a normal Lisp are much more straightforward in (idiomatic) Clojure.
The interop between Clojure and Java (or ClojureScript and JavaScript) seems to be a lot cleaner and more straightforward than the sometimes-ugly FFIs you see with other languages.
It has just about all the standard Lisp goodies, too (macros, etc.)
What destructuring? I didn't see any in the example.
I'd say start here, it will get you in the mindset of Clojure.
I read a fair amount of both and the former explains the subject matter too superficially IMHO. +1 for Joy of Clojure which is a nice read in parallel.
Joy of Clojure is a good book. It goes deeper while assuming more of the reader. The technical detail is useful and interesting, but for me, the narrative seems a bit less cohesive [disclaimer: I have the first edition, not the second]. I haven't read Clojure Programming.
[1]: Edit. For example the running exercise is porting a Java build system to Clojure. That's full on software engineering, not a let's-pretend.
I focused on Programming Clojure as it's almost half the size of Clojure Programming and I want to get to other, more focused clojure books (Reactive Programming, Macros). But for me, personally, the examples given so far (I've made it at least through the State-chapter) weren't well explained. I'll see how Clojure Programming holds up in that regard but so far many explanations have been better IMHO.