Tag Archives: elegance

Clojure: Where’s the Elegance?

I’ve looked at the relatively new functional programming language Clojure a bit and I have to say, I’m not impressed. Functional programming is an interesting pastime, and I’m sure it has it’s uses, but when it comes to language design, it’s as if the creators are deliberately going out of their way to make things difficult.

This site has a few tips for beginners, but I was especially struck by the section about namespaces, in which the author says, “There’s ns and in-ns and use and require and import…”

What first clued me in to some bad design ideas, however, was Clojure’s sequence functions (see the bottom of the page). The fact that there are 7 separate functions for getting a specific element from a sequence (first, ffirst, nfirst, second, nth, when-first, last) is strongly at odds with my preference for Python’s there-should-be-only-one-way-to-do-it philosophy. Also, why the inconsistency of having first and second functions but no third, fourth, fifth, and so on? (I think we know why.)

I know Clojure is young, but there’s a difference between a language that’s not mature and a language that’s immature. Design features like this don’t make me want to say, “Boy this is great; I can’t wait ’til Clojure is more developed.” It makes me want to say, “Oh grow up.”

This concludes another Truly Pointless Rant.