Over this past week I decided to take up Clojure (probably as a result of so much frustration with VBA making me seek out a sensible programming language to regain sanity…). So in this post I’ll discuss three things: why Clojure? And some of the pros of the language and some of the pitfalls (from a learners perspective). Let’s begin!
Why Clojure?
Clojure is a Lisp-variant that runs on the JVM. I say variant because although it has many similarities to Lisps, there are instances where Clojure is different (e.g. cosmetically removing redundant brackets). Furthermore, Clojure embraces the JVM – there is full integration with Java. If you have a class in Java to be ran, you can do so through Clojure in a simple, succinct, and easy to read way. As a Java programmer this was a huge plus as it gave me a sort of safety net in case I hated the rest of the language (which proved to not be the case). So why Clojure? Well I had three specific reasons for choosing it, which I’ll exclude from the pros and cons list since we’ll leave that for what I learned over the course of learning (yes, slightly redundant).
- Expressiveness – naive me read something about language expressiveness. What if I could write my Java programs in a tenth of the code! Think of all the productivity. (This turns out to be fairly accurate…)
- Readability – I find Lisps and Clojure in particular to be far more readable and aesthetically pleasing to look at. Why does this matter? Well going over thousands of lines of confusing Java and Python code can get confusing at times. This seems to be a more productive and sane alternative
- Functional programming – I’ve heard a lot about it and a lot of buzz regarding Common Lisp. Clojure seemed like the most friendly way to get into functional programming since, given the JVM environment and Java integration, there was a fallback to OOP.
Those were the three main reasons I ended up studying Clojure this past week. I would say it has paid off – the language is amazing in my opinion. If I had known about it two years ago I would have taken it up instead of Python. Anyways I spent the week learning it by developing a shoddy API (probably won’t maintain it haha, it was a learning experience), doing some 4clojure problems, messing around on tryclj, and reading a few books (these are non-affiliate links). Doing so I came across a few pros and cons of actually learning Clojure. Let’s start with the cons first though.
(more…)