I come from the land of C/C++, Java, Javacript, C#, Python etc...
You'll notice Lisp isn't on that list, I thought it was just a myth up until a little while ago.
So sure enough I started reading about Clojure, and so far so good, honestly the syntax is nice and it's pretty straightforward. I love pure functions and immutability and all that jazz.
But the documentation, Jesus the documentation...
Empires rise and empires fall based on their documentation.
You write a program and don't document it, a few months later it's like your own code is a monster from the abyss.
You build an airplane and you don't document and train people in it, and million dollar giant metal beasts fall from the sky.
You write a programming language and you don't fucking document it, and it'll die. It'll just die.
Let's compare good documentation to Clojure.
Let's say, in Javascript, I want to find the size of an element. I have no idea how to do this, so I Google: "javascript get element size".
If you ignore the stackoverflow spoon feeding, you get this:
https://developer.mozilla.org/en-US/docs/Web/API/CSS_Object_Model/Determining_the_dimensions_of_elements
Look at it. It's beautiful.
Now I know I can, for example, do element.getBoundingClientRect() and I'll get somewhere.
Now let's look at Clojure.
Let's say, I don't know how to get user input. Standard problem for someone new to Clojure, or just programming in general.
So you Google: "clojure get user input".
Once again we'll ignore the stackoverflow spoon feeding, because what happens if stackoverflow hasn't answered it yet? It does happen when you face something that's a little beyond the beginner level.
So we see:
https://clojuredocs.org/clojure.core/read-line
It's a bloody disaster innit?
Let's see what exactly is the problem here.
read-line
(read-line)
Reads the next line from stream that is the current value of in .
(read-line) is how you use it, fair enough, no problems there.
"Reads the next line from stream that is the current value of in ."
You fucking what mate. What is "in"? No link to in, it just says "in".
You google "clojure in" you get nothing of value.
Pretend I don't know what "stream" is, what is this even saying to me?
The one thing that's great are the user examples, but that is also its downfall as I'll show in the next example.
Let's say I'm reading some javascript code. I see this: something.querySelector() and I don't know what querySelector() is. So I google it.
https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector
Look at that. Again, it's beautiful. It doesn't just have one line of documentation, it has a whole page.
Next we're back to Clojure.
And I see this (doseq [somethinghere] (morehere)) and I want to know what doseq is.
https://clojuredocs.org/clojure.core/doseq
(doseq seq-exprs & body)
Repeatedly executes body (presumably for side-effects) with bindings and filtering as provided by "for". Does not retain the head of the sequence. Returns nil.
First of all, sequence-expressions or sequel express or sesquash experiment? The fuck is it? Clojure's constant use of shortened variables / functions etc... is infuriating.
Also if I didn't already know what & does I'd be completely lost there.
Now for the short description of what this thing does:
Repeatedly executes body (presumably for side-effects) with bindings and filtering as provided by "for". Does not retain the head of the sequence. Returns nil.
Presumably for side-effects is it? What if I don't presume, what the fuck does it do then? With bindings and filtering as provided by "for", oh no, not again! For!??! No link to for. Google time.
https://clojuredocs.org/clojure.core/for
Now I've got a whole 'nother set of documentation reading issues and all I wanted was to know what doseq does.
I said before that the examples weren't enough here, this is why:
Look at the first example, the issue here is that I didn't google "how to multiply every x by every y", it's a completely arbitrary problem and solution and really it doesn't explain what doseq actually does, just shows what it could potentially do. These are two separate issues.
I've run out of steam here, point is documentation please. Comments in the code please. Don't shorten your variables from 3 words to 1 letter please.
Keep the "examples" in the documentation, but I think it would be more important to add Related Links and User Explanations, out of all the users at least one or two should be an English teacher, I hope, otherwise we're screwed.
PS: Perhaps the biggest problem is that I can't even imagine how people learnt this language before https://www.braveclojure.com/ was written. The documentation on the main Clojure website I'm sure wasn't written for humans, maybe not by a human either.
PSS: /u/moxaj posted this link down below: https://www.youtube.com/watch?v=nrpsMB2gYI0
It doesn't have as much profanity (surprisingly) but it also says a lot about the state of Clojure's documentation. Honestly it paints an even worse picture than I thought, as soon as anything Clojure-like (is there already something?) but with better documentation comes along, Clojure will basically die. That's my prediction. Unless Clojure can start treating documentation seriously (both internally and externally).