One problem is that it first starts with a Person class, then it says nope, modules are not like this. So it increases the cognitive load for absolutely no reason.
Another problem is that an immutable singleton could have interesting properties, like it could have a type, it could be polymorphic (e.g. think Scala's objects), but this article presents Ocaml modules to be nothing more than namespaces. So first of all, that's not true and furthermore, I don't see the usefulness in that compared to any other language that can do namespaces. When reading about some construct of a language I don't know, I want to see how that construct is different or useful for me.
As I'm writing this, the article has 42 points and I'm left wondering why. I've long suspected that HN votes articles by keywords happening in the titles, without reading the articles.
> As I'm writing this, the article has 42 points and I'm left wondering why. I've long suspected that HN votes articles by keywords happening in the titles, without reading the articles.
I haven't read the article, but it would be great if whoever submits an article also had to enter one or more questions (with yes/no answers or one-word unambiguous answers) about it. Then, upon submitting a vote for the article, HN would prompt users to answer them. A suggestion to read the fine article would be given to people who cannot answer, and no upvote would happen.
Another problem is that an immutable singleton could have interesting properties, like it could have a type, it could be polymorphic (e.g. think Scala's objects), but this article presents Ocaml modules to be nothing more than namespaces. So first of all, that's not true and furthermore, I don't see the usefulness in that compared to any other language that can do namespaces. When reading about some construct of a language I don't know, I want to see how that construct is different or useful for me.
As I'm writing this, the article has 42 points and I'm left wondering why. I've long suspected that HN votes articles by keywords happening in the titles, without reading the articles.