1 Comment

Why I Choose ClojureScript

I’ve always enjoyed learning different programming languages. I’ve had colleagues who wished one language would emerge obviate all the others, but not me.

For me, programming languages are like food: it’s the variety that makes it fun. Every language makes different tradeoffs, they elevate different ideas, express them in different ways. Each is a unique tool in my toolbox.

I spend most of my time writing web browser applications, so I’ve experienced a wide gamut of languages, from plain JavaScript and ES6, to the syntactically sugary CoffeeScript and LiveScript, to less JavaScript-like languages such as Elm and ClojureScript.

But despite my love of languages, I recently settled down.

Starting a new project with an unfamiliar language and ecosystem may be fun and educational, but it’s also expensive and time-consuming. As projects pile up in my personal backlog, my focus has shifted from broadening my horizons to being more productive. But with so many available platforms, which to choose?

The book Switch: How to Change Things When Change is Hard recommends a useful strategy: look for the bright spots. Rather than picking a language at random, choosing my current favorite, or using some rule of thumb such as “keep it simple,” Switch suggests surveying past results and finding what languages and ecosystems allowed me to get the most done. Naturally results vary. Some languages I have more experience and practice with than others. Some have bigger communities and a better ecosystem. Nevertheless, one language stood out.

ClojureScript.

Over several years of personal projects, the ones I wrote in ClojureScript were by far the most complete and most sophisticated. I can guess some reasons (immutability and pure functions make sense to my math background, core.async fits my mental model of concurrency, some things can only be done with macros), but the reasons don’t matter as much as the fact: I’ve been much more productive building simple web applications with ClojureScript than any other language or ecosystem. I could try to explain it just as I could try to argue against it, but the results spoke for themselves.

Your bright spot may be different, but for the foreseeable future, I’ll be starting new projects in ClojureScript.