by benas · 6y ago · 0 comments
I could be wrong, but I don't find Clojure to be "simple" for humans to read (or write). Here is an example from the blog post:
So let’s write a simple one. Let’s write the factorial function.
(defn fac [x] (if (= x 1) 1 (* x (fac (dec x)))))
Note the "simple one" here. I don't know for others, but this is not simple for me as a human to read, understand and reason about. For instance: if (= x 1)
As a human, I read this like "if equals x one", which does not translate to my natural language where I would say "if x equals one". So I need an additional mental effort to do the translation. This is not the case in other languages where "if x equals one" would be written like "if x = 1" or "if (x == 1)". If the gap between the natural language and programming language is big, it is difficult for a human to use that programming language. And for Clojure, this gap is big IMO.(I (wanted) (to learn ((some)) Clojure in the past) but [quickly] ([(realized it was (not) for me)])) [2].
[1]: https://news.ycombinator.com/item?id=16430751
[2]: https://twitter.com/b_e_n_a_s/status/1244417191556063234?s=2...
(defn fac [x]
(if (= x 1)
1
(* x (fac (dec x)))))
> (I (wanted) (to learn ((some)) Clojure in the past) but [quickly] ([(realized it was (not) for me)]))This is missing semantics for morphology. Delimiters aren't strewn about randomly, they precisely delineate the AST.
(state-claim
(but
(past-tense
(desire (learn me clojure)))
(past-tense
(realize me (not (good-fit? me clojure))))))I'm not sure that follows from the original claim at all.
Mathematics has plenty of problems in when it comes to obscure terminology and regrettable notations, yet still vast numbers of people prefer the conciseness and precision of mathematics to using natural language when they want to discuss concepts in science, engineering, programming, etc.
At some point, if you're going to work in a technical field, you're going to need terminology and notation to match. Newbies to the field need to learn those before they can understand what is being said "naturally". The alternative is to attempt to dumb everything down to the point where newbies can understand it straight away but, assuming it is even possible, this risks losing a lot of effectiveness in communications between everyone who does have more experience.
[1]: https://en.wikipedia.org/wiki/Non-English-based_programming_...
(if (= a b c) true)
In JS it looks like this: if (a == b && b == c) return true;
Let’s build an even bigger one! Clojure: (if (or (= a b c)
(not= d e))
true)
And in JS: if ((a == b && b == c)
|| d != e)
return true;
More verbose, contains some weird symbols, and I’m not sure that my line breaks are helping anybody.Wanna see if an “array” is full of the same value?
(apply = [2 2 2])
In JS: [2, 2, 2].every( (val, i, arr) => val === arr[0] )
These are not pathological cases.English is not all natural languages. Verb-subject-object is the 3rd most common ordering in human languages[1]. Infix is not the only mathematical notation either[2]. I think we all benefit from mind-expansion from learning new languages.
[1] https://en.wikipedia.org/wiki/Verb–subject–object [2] https://en.wikipedia.org/wiki/Polish_notation
You gave an english quotation as an example of your natural language.
My only point is that there is no objective "natural" ordering, what is natural to each person depends on their starting point. Because this is somewhat arbitrary and provincial, it is good to be exposed to alternatives.