Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yeah I think the hype cycle with Clojure looks like this:

Stage 1: Confused by parens/the lispiness. early uncertainty

Stage 2: learn the REPL and library functions and fall in love. irrational exuberance

Stage 3: build an unmaintainable mess and can't refactor. trough of sorrow

Stage 4: figure out how to decouple appropriately and evolve the codebase rather than refactor all the time. live happily ever after!



Stage5: All other languages and their syntax now looks ugly and wrong. I'm mean for heavens sake put the parens on the outside ! We are not heathens.

Lol only half joking. It really did surprise me how can something I hated some much in the beginning of learning Clojure (all the parens) has now become one of the things I most adore about the language (all the parens)


It's really hard for me to see any justifications for a syntax that's not based around s-expressions. The benefits of being able to trivially transform any code as data and have powerful structural editing facilities outweigh any perceived downsides in my experience. I also find that s-exps act as a visual diagramming tool making your code more scannable because you can visually see the relationships between statements by looking at the nesting.


> I also find that s-exps act as a visual diagramming tool making your code more scannable because you can visually see the relationships between statements by looking at the nesting.

I think this is where people disagree regarding syntax. I love Clojure and agree with all the benefits of s-exps, but find it basically impossible to scan and very tedious to read. While it tends to be easy to refactor do to the REPL, at least for me it's on the wrong side of readability vs expressivity.


Could you elaborate on that. Why do you find s-exp syntax more tedious to read than other types of syntax?


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.


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.


ML (via Caml Light), Lisp, Smalltalk and Prolog did it for me, each on its own way.

Nowadays I am happy to see a bit of them on the languages I actually get to use.


This is the worldview of all apl developers.


Last time I listed my resume I added "prolog or apl please"




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: