3 ms·
Certainly on my own projects any and all dirty hacks are fair game. When I work with others I try to avoid being cute for cute's sake. I suppose it's no great
by fogus 16y ago
Certainly on my own projects any and all dirty hacks are fair game. When I work with others I try to avoid being cute for cute's sake. I suppose it's no great revelation that some prefer Ruby syntax to Clojure's. However, I can say that Clojure works hard to reduce the number of parens that you might find in similar Lisp or Scheme code. For example, the `let` form in Common Lisp looks like:
(let ((a 10) (b 20)) (* a b))
After many years using CL in school I can sympathize with the idea that Lisp is full of parens. Common Lisp's `let` is nicely delineated and is easy to reason about... for macro writers. Experienced Lisp users don't blink an eye at this. However, Clojure takes a different approach:
(let [a 10, b 20] (* a b))
There are still parens, but they've been reduced leading to (IMO mind you) a cleaner look. Our opinions clearly differ on aesthetics, but I think it's worth noting that Clojure libraries will strive for the latter over the former.
- kunley 16y agoIt's true that average Clojure code looks cleaner than average CL code. Still I'm looking for something more cleaner, still being a Lisp. Time for Arc maybe :]
- fogus 16y agoI wish I could speak for Arc, but sadly I can't say that I know more than superficialities. Hopefully someone else can chime in. Let me say that the example with `let` is just a small example of an over-arching trend in the way Clojure code looks vs. CL. I would love to hear more about Arc's approach.