Learning Clojure: Where to Start

It will change your life. That's the definition of doing something different right?

Learning Clojure: Where to Start

When I started learning Clojure, I struggled to get started. There aren't a ton of resources available online. Not compared to languages like python, ruby, java, etc. anyway. You can google for days, drown in reddit threads, and spend enough time on hackernews to wonder why you even try. The worst part, most of what you find isn't in any way addressed to someone getting started with Clojure.

This post is a digest of what I learned while I was trying to figure it all out. I am by no means an expert, but these are the things that got me going. These resources are all free. It's possible there are better resources if you're willing to pay.

Getting Started

It feels wrong not to reference the Clojure - Getting Started website first. So there it is.

Installing Clojure

Go no further than Eric Normand's How to Install Clojure. You won't need anything else.

Build tool

Start with Leiningen. Almost every tutorial, blog post, etc. I went through involved Leiningen. Many big name Clojure developers use Boot, but I've had no regrets starting with and using Leiningen.

Editors

What kind of editors are you used to?

Fully featured heavy-weight IDE's? Try out Intellij IntelliJ IDEA with the Cursive plugin.

Lightweight editors? Go with vscode and the Calva extension. There are setups using Atom and some really nice packages, but Calva "just worked".

Emacs, or you're the adventurous type? As of this writing, I think Emacs with Cider is the most used development environment for Clojure. I prefer Vim or at least Vim keybindings, but I still think this is worth a shot. If you prefer vim keybindings like me, try out Spacemacs coupled with the Practicalli Spacemacs guide.

Learning

I usually like to start with something that is really easy to jump into. The optimal solution is one where I don't even need to install the language. Maria is great for this. All you need is a browser, and you can start learning Clojure in small easy steps with great visualizations.

Once you get moving, if you want to stick with the browser to try out your own code, Replumb Online REPL is a great online repl environment. The cheatsheet below the repl is really nice when you're getting started.

Once you're ready to dive a little deeper, try out Clojure for the Brave and True. It's a fun book that will keep you motivated. It's available to read for free online.

ClojureScript Frontend Framework

The one I see referenced most these days is Reagent. Often coupled with Re-frame

Backend Framework

This one I've never been able to pin down. If you like light lighter frameworks Compojure with Ring seems like the favorite. If you like large frameworks, I've seen Fulcro and Luminous mentioned a few times.

Other helpful and cool stuff

Cheshire. These days it seems like if you can't do JSON, you can't do programming. Cheshire is a popular way to handle JSON in Clojure.

Devcards. Interactive visual repl for frontend components in ClojureScript. It speaks for itself.

Arcadia. Cojure in Unity? Yes, please.

Lumo. Standalone ClojureScript environment that runs on Node.js. Sometimes booting up a Clojure repl can take longer than you want. Since Lumo doesn't require the JVM, it starts up incredibly fast!

Clojure Spec. I struggle without static typing. Clojure's design choices aleviate a lot of the problems I have when using JavaScript, Ruby, and the like. Yet I still struggle to jump into Clojure codebases because of the lack of types. Even my own.

Spec has the potential to be something special. It's not just about types. It can help with testing, and feels like it can stretch towards dependent typing without getting in your way. Spec is a beautiful thing.

Etc

Cheatsheets are helpful. If your background is with typed programming languages, it can be a chore to find the the functions you're looking for. Having cheatsheet open while you code can be helpful.

Here's the Clojure Cheatsheet.
And here's a ClojureScript Cheatsheet.

Last but not least. Join the Clojurians Slack! There are tons of awesome people willing to help!

Reference: How to Install Clojure, Clojure for the Brave and True, Maria, Calva, ClojureScript Cheatsheet, Replumb Online REPL, Lumo, Cursive, Leiningen, Clojure - Getting Started, Practicalli Spacemacs guide, Cider, Spacemacs, Clojure Cheatsheet, Luminous, Compojure, Ring, Reagent, Re-frame, Luminous, Fulcro, Clojurians Slack, Cheshire, Devcards, Arcadia, Lumo, Clojure Spec