3

An opinionated list of excellent Clojure learning materials

 1 year ago
source link: https://gist.github.com/ssrihari/0bf159afb781eef7cc552a1a0b17786f
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

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.

  • red_circle Mandatory (for both beginners and intermediates)
  • green_square For beginners
  • yellow_square For intermediates

Table of contents

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.

  • red_circleClojure 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.
  • green_square 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.

  • green_squareLearn Clojure in Y minutes: useful as a quick revision of the basics once you've done one of the above "courses".

Exercises

  • red_circle4clojure: 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.
  • green_squareExercism
  • green_squareClojure Koans
  • green_squareMars 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.

  • red_circleSimple 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.
  • green_squareSimplicity Aint easy: A nice follow up to Rich's talk, with specific examples and how it applies to every day programming.
  • yellow_squareValue of values: This will take a few re-watches to grok. Alternatively, watch this when you've got your feet wet with Clojure.
  • yellow_squareClojure's approach to identity and state: Rich hickey looking over his glasses, telling you you're doing it wrong.
  • red_circleJoC 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.
  • red_circleSolving 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".
  • green_squareHammock Driven Development: Generally good advice on sleep, and using "thinking" as a tool.

Rationale

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.

  • red_circleRationale page in guides: Start there, but mostly read all the guides. They're well done.
  • yellow_squareAre we there yet?: Consider this a must-watch if you're coming from an object oriented programming background.
  • yellow_square Rich's A History of Clojure (2020): the whole story, and some fun comparisons with other language evolutions.
  • yellow_squareMaybe 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

  • green_squareSandy'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.
  • red_circle 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.

  • red_circleStu'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.
  • green_squareSean 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.
  • green_squareThe official guide: Multi part tutorial.
  • green_square 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:

  • red_circleCommunity 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.
  • red_circleLinting: Set up clj kondo, it'll help you adhere to that style guide, and then teach you some Clojure guidelines along the way.
  • red_circleDestructuring: I see a lot of newcomers missing out on good destructuring, and this is the article I usually point them to.
  • red_circlePrismatic/Plumatic guides: Read all 3 of these. I keep linking people to them whenever they are grappling with datastructure decisions.
  • green_squareStuart 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.
  • green_squareRunning with scissors: Another talk by Stu, reminding you to use the REPL.
  • yellow_squareData > Functions > Macros: I wish there were more material on this. It is a large influence on design in FP.

Error handling

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

Debugging

Modeling, and Organising code

  • yellow_squareClojureverse 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.
  • yellow_squareFunctional 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.
  • yellow_squareHow to name functions: This is a great article that I keep referring people to.
  • yellow_squareRedundant map: One of the top suggestions in my refactoring sessions, usually.
  • yellow_squareElements of Clojure: This is a gold mine on naming things well.
  • yellow_squareNamespace organisation: The fundamentals are solid in this article. I might use namespaces for large sections of code though.
  • green_squareThe 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

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.

TODO: Testing in Clojure

  • yellow_square TDD vs REPL DD
  • yellow_square Generative testing
  • green_square Sandy's video
  • yellow_square Lambda island, and Eric normand episodes

Other such lists


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK