Hacker News new | ask | show | jobs
by weavejester 4220 days ago
"Implemented a scheme in my undergraduate days (in C), had a small love affair with LISP in general... It's not readable. It really isn't."

Hang on. Your opinion is that Clojure isn't readable because you didn't find other Lisps readable when you were an undergraduate? But you haven't actually tried Clojure yourself?

I have tried Clojure, and my opinion is that it's easily the most readable programming language I've found.

Clojure has very strong opinions about complexity, which in Clojure parlance is a measurement of interconnectedness between components. The language is built around the idea of reducing complexity, about making things isolated and independent. Idiomatic Clojure code therefore tends to have a very flat structure consisting of isolated functions and data structures. It has a very high degree of code reuse, because it explicitly rejects encapsulation.

Clojure's syntax may be unusual, and individual forms are more information dense than many languages, however the structure of Clojure code is often much easier to understand, and for any non-trivial piece of code, that's the hardest part of comprehension.

When I come across a new Clojure library, I'll often find myself reading a bit of the docs, then heading into the source code to get an idea of how it operates. I rarely do this with an object orientated language, as OOP code tends to be deeper, more interconnected, and because of encapsulation, have more methods to understand. Java in particular is terrible for this.

1 comments

I've written applications using Java, Groovy, Clojure and Scala (in that order) and after Clojure, coding Scala felt specially horrible (yet another syntax to learn! ++: \ ~> and so on...).

Maybe Clojure feels odd for a few hours when coming from C-like syntax, but it becomes so obvious later on. I remember I felt terrified by the parens because I had not written anything serious in it.

> I've written applications using Java, Groovy, Clojure and Scala (in that order)

I'd say the most natural pathways for Java programmers upgrading their language skills are:

* from Java, to Groovy, to Clojure

* from Java, to Groovy, to Scala

* from Java, direct to Clojure

* from Java, direct to Scala

Once someone reaches Clojure and Scala, they seem unwilling to give up what they've gained (the simplicity and macros of Clojure, or the higher-order typing of Scala) to switch to something else, even when that something offers more.

> yet another syntax to learn! ++: \ ~> and so on...

Syntax? Not seeing any syntax here.