Admittedly, I was mildly shocked and a bit scared when stumbling over @ZackMaril’s recent tweet claiming Clojure was a dying language. A huge discussion was sparked and a lot has been written since. A summary can be found in Arne Brasseur’s post which also offers some good insight into the community behind Clojure. Eric Normand added another layer of abstraction today and collected some more links in this week’s Drama edition of the purelyfunctional.tv newsletter.
I share Dan Lebrero’s sentiment on Clojure. Clojure taught me lessons and introduced concepts to me that I do not want to miss any more. First and foremost I love the built-in immutable collections. Immutability as default is a milestone in my life as a developer. I compare it to git, pair-programming, continuous integration and IntelliJ IDEA (with Cursive now, of course). There was a time when I did not even know about each of these. Now I cannot imagine to ever work without any of them.
In this post I want to emphasize another not less important aspect: Productivity. With Clojure we get a whole lot of stuff done. Seriously.
My team is working with Clojure for almost three years now. We came from an all-Java world and decided to be a polyglot team. We chose Clojure, Scala and Python to be our primary languages. None of the developers that joined us since has had any prior experience with neither Clojure nor Scala. With our pair programming routine and our microservice architecture we get newbies started up quickly, however.
From this experience I can testify that Clojure is more than easy to pick up. New team members – from student interns to seasoned hackers – are usually productive in days rather than weeks. Our ’non technical‘ team members – production leads, business designers and the like – started hacking Clojure, too and are now able to automate some of their tasks and also to help out the developers.
The fact that Clojure has hardly any syntax and its strive for a radical simplicity contribute to the ease of picking it up. This is much in contrast to e.g. the syntax-heavy Scala.
Imagine the following situation: You have some change to apply to your software. By gut feeling it might take the afternoon. You sit down with your pair/buddy and discuss the problem. You are TDD-folks, so you write a test that assumes the yet to be built functionality. It is red. You say „Ok. Before we start coding, let me quickly draft this in some simple pseudo-code.“ You do just that. Your pair runs the test. It is green. You look at each other: „Are we done?“ You look at the code again. You are. It’s been 20 minutes.
This experience you could not have explained to my former java-developer-me no matter how hard you tried. Yet it happens every day. Clojure has that way of seemingly effortless materializing one’s thoughts into working code that I do not know from any other language. (There is, of course, plenty of languages I don’t know.)
When analyzing a piece of Clojure code, the code itself quickly steps aside and opens the the view on the problem at hand. It is again the minimalistic syntax and the focus on simplicity that make it easy to reason about the code. The language imposes little mental overhead when investigating issues. This is even true when discussing the problem with someone that does not know Clojure at all. It’s within minutes that the discussion moves from analyzing the code path to the business aspects of the problem.
This also extends to library code which oftentimes is astoundingly concise and gives you a fair chance to understand the inner workings of a library. Again this is not necessarily true when dealing with a language that is richer with syntax options.
Getting stuff done
In the recent discussion it was often said that Clojure does not per se make a team more productive. I think the opposite is true. Clojure’s design decisions do result in an amazingly productive language.
It is efficient to develop new functionality. There are little barriers in analyzing problems and exploring unknown code. It has excellent tooling. It’s fun. Is it dying? Heck, no! If you wanted to kill it, you’d have to wrestle it from my cold, dead hands first.
I can only guess that we are representative for a whole lot of teams in a whole lot of companies which happily and quietly enjoy the productivity of Clojure. No Drama.
PPS: We still use Scala. We even like it. At least – but not only – for the highly different approach on programming. Looking at a problem from two different angles is a value in itself. Polyglot rocks!
PPPS: Honk if you love Clojure!