Hacker News new | ask | show | jobs
by __jem 1215 days ago
When I look at Clojure code, it just looks like noise, all the forms look the same. For example, a let and a doseq at first glance might look almost identical in terms of their "shape." In something like Java, a for-loop "looks" like a for-loop, there's nothing else in the language that looks quite like it. If I see a series of chained lambdas, there's an extremely high chance I'm looking at a stream, etc. The syntax helps me here by adding more obvious visual markers.

The argument I'd make in favor of Clojure and s-epxs is that, when you write good functional code that composes lots of small functions, it can literally read just like English. If foo and bar do baz else qux. But bad Clojure code doesn't have this property to me, it just looks like a lot of noise.

2 comments

Stupid question, but do you have something like "rainbow-brackets" active in youre code-editor ? I found it really help me. The more I read LISP/Clojure code the easier it becomes.
I agree that it's possible to write dense code that's hard to read with Clojure, but that is true in any language. I've seen plenty of Java codebases that I couldn't make heads or tails of. As you point out, well written Clojure often reads like plain English. So, in my view it's just a matter of making the effort to write readable code on the part of the developer.