3 ms·
Honestly, I wish Clojure had more parenthesis. As a Lisp fan, square brakets make me grrr. I don't want to have to think about which delimiter I need where.
by pmoriarty 8y ago
Honestly, I wish Clojure had more parenthesis. As a Lisp fan, square brakets make me grrr.
I don't want to have to think about which delimiter I need where. Knowing that it's always going to be a parenthesis makes my life so much easier.
- narwally 8y agoThat's true for writing code, but I think the man benefit is when you're reading it. Parenthesis tell me that there is a function application occurring, and square brackets tell be that bindings are being initialized. Then parenthesis, square brackets, and curly braces help me easily find lists, vectors, maps, and sets just from a quick visual scan of the code. Clojure also does a nice job of eliminating unnecessary parens, such as the ones surrounding pairs in a let binding. So instead of this: (let ((x 1) (y 2)) (+ x y)) In Clojure, it becomes: (let [x 1 y 2] (+ x y))
- pmoriarty 8y agoI don't think I've ever been confused as to which were the bindings in a let block. It's obvious from the indentation and the parenthesis. Granted, it's a bit easier to pick them out with square brackets, but for my taste I'd rather just have homegenous delimiters everywhere.
- kbp 8y ago> Then parenthesis, square brackets, and curly braces help me easily find lists, vectors, maps, and sets just from a quick visual scan of the code. How often do you want to do that? Wouldn't you be more interested in what the variable is called or who it's passed to?