Trying Clojure Again

1 minute read

I first started trying Clojure 4 or 5 years ago with only moderate success and not much dedication. Recently, I purchased the 2nd edition of Programming Clojure and am working my way through it very slowly. The biggest change I’ve noticed is how different the ecosystem is now. Leiningen has drastically changed getting up and running with Clojure. It doesn’t hurt that I do all development on a Mac now whereas 5 years ago it was all Windows.

I’m working my way through the Clojure Koans as well as the book. I go back and forth between reading and writing code, trying to memorize as much of the clojure.core as I can. A comment I saw on Hacker News today was apropos: “I knew how clojure felt and behaved, but IMHO you still have to memorize most of the core library, or most code will look confusing.” The code is just foreign still to a guy coming from C#, Python, Ruby, etc. Though I will say that some of the more advanced Ruby I read is similar in nature, at least to my eyes. The syntax is very terse. The shorthand for anonymous functions alone makes my eyes hurt. I’m sure the more I stare at it, the less that will be.

Today, I started learning several of the predicates in clojure.core including subset?. Part of my strategy is to search the documentation for a new function and try to learn it by writing some code using it. Four years ago, it seemed like knowing the core library very well was key to success as I would write a bunch of lines of code only to later discover that functionality was built in.

One goal of learning Clojure is to finally get the functional mental shift to happen so that my Javascript becomes much stronger. I’m watching the Pluralsight course on Javascript The Good Parts by Crockford along with reading Javascript Allonge. It’s clear that until that functional mental shift happens, a lot of this will remain slightly foreign.