3 ms·
I've been playing around with Clojure, having a lot of fun, and enjoying the community around the language. I love it, I absolutely love it, and I will come aro
by billjings 7y ago
I've been playing around with Clojure, having a lot of fun, and enjoying the community around the language. I love it, I absolutely love it, and I will come around to saying some glowing things about it at the end of this comment.
But first...
When I saw Bob Martin writing about it, it was a bit of a, "Damn.. Spaceballs!" moment. And the post itself didn't exactly light me on fire. So I don't know if this is the greatest introduction to the language.
And to be honest, the syntax is hard to read. It imposes more structure on everything you do: certain kinds of operations require more nesting, more context. Nothing just sits on the page with a standard layout and structure: it's always governed by these parantheses that are running around all willy nilly. And that's just harder to read.
BUT. There is one huge, huge, huge, huge win from it:
Every single thing in the language works the same way. Everything! It's all just expressions.
That might seem like no big deal. But as a programmer, it means that if I don't understand why a piece of my program isn't working, all I have to do is put my cursor right after the expression I want to understand and type C-c C-e to evaluate that subexpression.
So if
(defn f [x] (+ (* 3 x) 1))
...isn't working as I expect, I don't have to run (f 5). I can bind x to 5 and evaluate (* 3 x). And the same applies to any larger program I write.
There are other things that I love about Clojure, but this has certainly been a breath of fresh air coming from other languages that have more ceremony. It is liberating to be able to isolate and assess a portion of code without having to refactor it into a standalone method. I can move much faster, and have a lot more fun.
- TurboHaskal 7y agoIt's all about reducing the feedback loop. Expression based, late binding languages with interactive environments can't be topped.