An opinionated list of excellent Clojure learning materials
These resources (articles, books, and videos) are useful when you're starting to learn the language, or when you're learning a specific part of the language. This an opinionated list, no doubt. I've compiled this list from writing and teaching Clojure over the last 10 years.
- 🔴 Mandatory (for both beginners and intermediates)
- 🟩 For beginners
- 🟨 For intermediates
Table of contents
- Getting into the language
- Sit back and understand the language
- Books or Courses
- Getting comfortable with the editor and REPL
- Application programming in Clojure
- Error handling
- Modeling, and Organising code
- Functional programming for people coming from OO
- Beyond the basics
- Other such lists
Getting into the language
Use these to get a hang of the language in a quick manner. Deeper than a hello world, less deep than a book.
- 🔴 Clojure from the ground up: This is Aphyr's excellent introduction to the language. Follow along with your editor and REPL set up, write every line of code. Explore as you feel like. Following the entire course will take a few days at most, and is excellent at bringing you up to speed on the basics.
- 🟩 Rich's introduction / demo of the language to Java and Lisp Programmers. Straight from the horse's mouth, this is an authoritative introduction to the language. Rich himself spent a lot of time teaching programming, so this is a pretty good course to follow along. Tag along with your REPL, pausing the videos when you want to try things out. Doesn't matter if you're not from a Java / Lisp background.
- 🟩 Learn Clojure in Y minutes: useful as a quick revision of the basics once you've done one of the above "courses".
- 🔴 4clojure: This was a big part of how I learnt Clojure. Do all the elementary, easy, and medium ones. Do some hard ones too. Look at other people's solutions, and re-write your solutions. This is a drill in Clojure basics, and is very effective.
- 🟩 Exercism
- 🟩 Clojure Koans
- 🟩 Mars Rover: This is a simple problem (not just plain math/data munging) that lets you explore some domain modelling, writing tests, etc.
Sit back and understand the language
A language influences the way you think. It can change your paradigm of thought, and you need to let it do that so that you can really understand it when you use it. These videos, especially the ones by Rich are powerful, and are a large part of the reason for Clojure's adoption today. Watch / read these (maybe one or two per day) on the side as you learn Clojure.
- 🔴 Simple made easy: This talk transcends the language, and makes its way into changing how you think about.. thinking. Un-twine those ropes, separate those concerns, and decomplect your life.
- 🟩 Simplicity Aint easy: A nice follow up to Rich's talk, with specific examples and how it applies to every day programming.
- 🟨 Value of values: This will take a few re-watches to grok. Alternatively, watch this when you've got your feet wet with Clojure.
- 🟨 Clojure's approach to identity and state: Rich hickey looking over his glasses, telling you you're doing it wrong.
- 🔴 JoC chapter 1, 2: This is what my peers and I used when we initially learnt Clojure. It's what I would prescribe time and again if asked for one textbook to follow. At least read the first 2 chapters to understand the philosophy.. I somehow find other books lacking on that front.
- 🔴 Solving problems the Clojure way: I've seen this talk repeatedly make people go "oh yeah, that makes sense, the puzzle sort of came together with this".
- 🟩 Hammock Driven Development: Generally good advice on sleep, and using "thinking" as a tool.
Why was the language designed this way? It helps to get into the maker's mind a little to make effective use of the language.
- 🔴 Rationale page in guides: Start there, but mostly read all the guides. They're well done.
- 🟨 Are we there yet?: Consider this a must-watch if you're coming from an object oriented programming background.
- 🟨 Rich's A History of Clojure (2020): the whole story, and some fun comparisons with other language evolutions.
- 🟨 Maybe Not (Nov 2018): On the choice of a dynamically typed language, with some Haskell bashing on the side.
Books or Courses
- Joy of Clojure: What I normally suggest. It's a bit old school (imo), and what's considered a textbook at nilenso. It's a bit dry, but effective if you're up for a slightly steep learning curve.
- Clojure programming: This is what the new kids on the block are reading, I hear good things about it. It's also writted by absolute rockstars.
- Clojure by example: This was used in IN/Clojure workshops for 1 day introductory crash courses. Consider it strongly if you like learning by example.
- Clojure for the brave and true: A fun book, and easy to follow along. Has a good section on macros.
- The little schemer: Not Clojure, but an excellent read.
- Eric Normand's Courses: They're paid, but I would recommend these if you're looking for full courses that'll get you upskilled in a relatively short time period.
- Lambda Island's courses: Check out the episodes on React/Reagent, and Testing. They're free!
Getting comfortable with the editor and REPL
- 🟩 Sandy's videos: Sandy made these excellent tutorials on youtube about setting up the editor, using the REPL, and debugging. They'll set you up well for success, I think.
- 🔴 Structural editing: Writing a lisp isn't like writing most other languages. You're editing the AST, yo. Gotsto use the right tools for it.
- 🔴 Stu's Repl Driven Development talk: People say the REPL is Clojure's best feature, so you got to learn how to use it well. This talk helps.
- 🟩 Sean Corfield's demo: I've heard people say this hit home for them. Sean builds a web app from scratch in Clojure, using the REPL.
- 🟩 The official guide: Multi part tutorial.
- 🟩 Just google "REPL Driven Development", you'll see a whole bunch of videos and tutorials other than these.
Application programming in Clojure
When you're serious about using Clojure for your job, you got to sharpen certain edges, and polish up. Here are some resources I usually point people to:
- 🔴 Community style guide: Format your code right. Read this end-to-end once you've written some Clojure, and then come back to it as a reference when you're unsure.
- 🔴 Linting: Set up clj kondo, it'll help you adhere to that style guide, and then teach you some Clojure guidelines along the way.
- 🔴 Destructuring: I see a lot of newcomers missing out on good destructuring, and this is the article I usually point them to.
- 🔴 Prismatic/Plumatic guides: Read all 3 of these. I keep linking people to them whenever they are grappling with datastructure decisions.
- 🟩 Stuart sierra's dos and donts list: Read all of these. I keep referring people to the article on naming functions, read that one at least.
- 🟩 Running with scissors: Another talk by Stu, reminding you to use the REPL.
- 🟨 Data > Functions > Macros: I wish there were more material on this. It is a large influence on design in FP.
The community doesn't have a canonical answer to this. And your approach would largely depend on whether you like exceptions or not. There are a lot of articles and discussions around this, but nothing that summarises it perhaps.
- Might be worth going through some interesting discussions in clojureverse: 1, 2, 3
- Want a monadic approach? Use Failjure. But also read the related blogs.
- [WIP] Railway oriented programming
- [WIP] Erlang style error tuple
- [WIP] Exceptions, and how to use them effectively
- 🔴 Sandy's video about scientific debugging: A much more accessible, every day debugging tutorial.
- 🟨 Debugging with the scientific method: How Stu uses the REPL to debug. Remember: he's really good at debugging.
Modeling, and Organising code
- 🟨 Clojureverse Discussion: This is a very detailed (and long) discussion, with a few different views. It'll be good to have these ideas in a condensed form somewhere.
- 🟨 Functional Core Imperative shell: This is a predominant way of structuring code in functional lanugages, and Shantanu does a great job of eludicating the rationale and benefits here.
- 🟨 How to name functions: This is a great article that I keep referring people to.
- 🟨 Redundant map: One of the top suggestions in my refactoring sessions, usually.
- 🟨 Elements of Clojure: This is a gold mine on naming things well.
- 🟨 Namespace organisation: The fundamentals are solid in this article. I might use namespaces for large sections of code though.
- 🟩 The sequences part of Programming Clojure: This is a lucid introduction to interface design used in clojure.core for sequences. However, it's broadly applicable for interface / protocol design in applications as well.
Functional programming for people coming from OO
- 🟨 FP for the Object Oriented Programmer
- 🟨 When to use OO data structures in Clojure
- 🟨 SOLID in Clojure, Design Patterns in Clojure
- 🟨 Clojure for Java programmers
Beyond the basics
These aren't essential to learning Clojure, but they open up your mind to certain surprising paradigms of thought. I haven't had the time to write about them yet.
- 🟨 Clojure vs the static typing world
- 🟨 Zach’s abstraction talk
- 🟨 Tim Baldridge’s talk about core-async implementation
TODO: Testing in Clojure
- 🟨 TDD vs REPL DD
- 🟨 Generative testing
- 🟩 Sandy's video
- 🟨 Lambda island, and Eric normand episodes