Behavioral product strategist and gamification designer. This is my public hypertext notebook, sharing my thinking in motion at various stages of development.

Home

What I like about Clojure

The syntax of Clojure is simple and uniform. In order to enable learnable programming, people should not have to think hard about syntax. When I look at code in other languages, I see so much syntax that I don't even want to think about learning it.

An excerpt from my notes on The Joy of Clojure

In Clojure, just about everything you'll do is (operator argument argument). The fact that it's a lot of parentheses doesn't scare me… if anything, it makes it look more uniform and consistent.

Some example functions:

(+ 1 2) 
; adds 1 and 2

(+ 3 (/ 6 2))
; adds 3 and 3

(define x "hello")
; defines the var x as the string "hello"

(reverse [1 2 3 4])
;reverses the order to '(4 3 2 1)

You can even use Parinfer to make it so Clojure is basically an indentation language, reducing the syntax overhead even more. You barely need to pay attention to parentheses, they're more or less just a prefix at that point.

I love that functions can be treated as arguments for other functions. Clojure (and Lisp more generally) is so composable that I am able to make extremely simple and direct fill in the blank functions. See Direct functions and end-user programming. The fact that Clojure is programmed to abstractions means that Clojure is basically just sequence manipulation.

I also love the The data-driven programming mental model.

This thread has more of my early thoughts on that: