by elias94 · 5y ago · 0 comments
Clojure is simple.
Nearly everything is just (function arg1 arg2 ...), even at a fundamental language level. It's actually our background experience in complex languages with all kinds of wacky syntax that makes Clojure seem hard at first. But it's very simple. So if you can't remember the syntax or why something is the way it is, step back and you'll realize it's just (function arg1 arg2 ...).
For example:
(defn add-these [x y] (+ x y))
is still just
(function arg1 arg2 arg3)
Where:
function = defn
arg1 = add-these (a symbol)
arg2 = [x y] (a vector)
arg3 = (+ x y) (an expression, which itself is just (function arg1 arg2))
You may already know all that, but regardless I hope it's encouraging because the bottom line is Clojure is easer than you think and you can do it! :-)
Clojure is actually simpler (and eventually way, way easier) than most mainstream languages. It's just a bit different from what most people are used to and what is commonly taught as "programming".
1. There are several fantastic books on Clojure. The Joy of Clojure and Elements of Clojure are some of my favorites.
2. Watching a professional using an editor/IDE with a REPL attached to it. Look for online videos. This is the biggest reason to why people are „addicted“ to it. The language and it’s ecosystem are made in a way that enables this „living in the code“ experience.
I am interested in the actual Clojure bits. I mean, I know Lisp syntax and functional programming basics. But one also needs language-specific things: standard libraries, namespaces, etc. What is a nice resource for these?