← Back to home

Uncle Bob on Clojure

Uncle Bob on Clojure:

The language has almost no syntax or grammar.

I’ve seen engineers being excited about languages with a plethora of syntax constructs, and engineers that don’t like them. I tend to think that the abundance of grammar comes from a need, most likely the need of speed (haha, should have said “performance” but couldn’t hold it), module organization and access rights. Some languages require a daily interaction with these intricacies. The litmus test is the following: when reviewing code of your peers, how many times do you think about these concerns vs what the author tries to achieve?

It’s sad if the language has a bloated syntax for composition. None of the widespread languages have yet beaten shell: cat users.txt | grep “John” | wc -l. Clojure is close: (->> “users.txt” slurp (filter #(clojure.string/includes? % “John”)) count). I can write a one liner for it in JavaScript too. The problem there is not that I can chain the functions and method calls easily. The problem is that there are functions and method calls, and that they return various types of things. In case of shell it’s just text in, text out. In case of Clojure it’s always a function call, returning either values or sequences. I tend to think that it’s the data structures that make systems composable. If we have only a handful of them, then there’s little chance for glue code.

Syntax variation inhibits reuse.

I want a language where I spend 90% of my time not even thinking about performance, modules or access rights. And then 10% of my time I can spend on writing bloated, optimized, low level, unreadable code. I‘m happy to pay the bloatedness tax when there’s a reason.

Last edited on Aug 23, 2019