Why learn obscure languages like Clojure?

Why learn obscure languages like Clojure?

I was re-reading some of my blogs from more than a year ago and came across this one from September 2014 which I feel is just as relevant and I feel even more strongly about so I thought I'd re-publish it here (with a couple of small updates):

One of the questions I get asked, quite rightly, by the non-development people in clients is why bother with learning Clojure, or even Scala?

So, I could explain how:

  • Functional programming tends to result in a smaller code base that’s easier to test.
  • Programming with immutable data structures makes reasoning about the impact of multiple threads easier. They also make testing functions easier.
  • Concurrent programming support like atoms, software transactional memory and agents mean modern massively concurrent applications are easier to construct. Additionally asynchronous libraries like core.async make reasoning about concurrency even easier.
  • Clojure encourages developing applications by composing small lightweight libraries rather than large heavyweight frameworks which makes swapping out implementations that don’t support future requirements or adding new functionality much easier.
  • Developing with tools like a REPL (Clojure) shortens the feedback loop to seconds making developing quicker and safer.
  • Functions are composable to make for better reuse at different levels.
  • Meta programming using structures like traits or macros makes developing Domain Specific Languages that express the problem space easier and hence focus on the actual business problem.
  • Using the same syntax and the same libraries across client and server (e.g. Clojure and Clojurescript) reduces the cognitive load of having to language switch when moving from one to the other. In addition isomorphic applications open up the ability for traditionally server focussed developers to help work on the front end client and vice versa.
  • Clojure tends to encourage state change to be isolated and contained to small discrete parts of the application (usually the edges) which makes reasoning about behaviour, testing pure functions, mocking state, etc. easier.

However, none of this matters to business people or even senior technical managers in most of my clients. They will argue getting large numbers of developers with experience in these languages is hard to impossible.


So why bother?

  • Because these languages generally self select good developers.
  • Because developing in these languages means solving algorithmic problems which develops good problem solving skills.
  • Because developers who have more than one programming language tend to learn other more quickly and are more versatile.
  • Because developing in these languages is fun and that promotes better staff retention.
  • Because techniques beyond OO expand a developers armoury to tackle real world problems.
  • Because developers exposed to smaller, functional code bases tend towards writing cleaner, easier to maintain code and this reduces the overall ‘cost of ownership’.
  • Because these languages are generally more productive so you can get more functionality implemented with less developers (so you don't need to hire hoards of them)
  • Because throwing away your current language for something more carefully designed for modern development will mean retraining your developers from more modern techniques and if the language doesn't even support their current bad habits they can't reproduce them in the new codebase.
  • Because recruiting for developers willing to learn a new functional programming approach is actually easier than recruiting for developers with really good habits in some older languages that have been abused over the years.
  • Because, something like Clojure, can interop with Java so if your codebase is already written in Java you don't have to start from scratch.

But if you don’t want any of this, sure don’t bother to learn anything. Go back to writing COBOL, or assembler. Nothing wrong with those languages of course (I made a living for many years writing code in both!) but things move on.

Really good points. I love the simplicity and flexibility of Clojure. I've not delved into some of the more advanced topics. I suspect they're not all that complicated. This is possibly one of the simplest functional programming languages around. It has a very clear focus on data and on functions that work with data. I'd recommend Rich Hickey's talk titled "Simple made easy" to understanding the rational behind Clojure.

To view or add a comment, sign in

More articles by Chris Howe-Jones

Others also viewed

Explore content categories