If someone tells you repeatedly that something isn’t hard, maybe it’s just hard.
Monads
A post by Gilad Bracha got me thinking about this. He says
Last time I looked, the Haskell wiki listed 29 tutorials on [monads]. … Could it just be that people just have a hard time understanding monads? If so, what are the prospects of mass adoption?
Monads are not that difficult, but when you have hundreds of tutorials (besides the ones on the Wiki mentioned above) telling you that monads are not hard, maybe they’re hard, at least hard enough for enough people that they’ll never see mass adoption.
I imagine that if something really were much easier if you just look at it the right way, there wouldn’t be that many publications saying so. One or at most a small number of publications would be popular. For example, Mendeleev noticed that the properties of chemical elements were easier to think about if you arranged the elements in a particular tabular form, and everyone agreed, and Mendeleev’s approach won.
The fact that there are hundreds of monad tutorials suggests that many people have independently had an epiphany about monads and wanted to blog about it. I don’t disparage this at all. Many of my blog posts come about this same way: I’ll understand something and write about it while the inspiration is fresh, for my own future reference as well as for the benefit of others.
I also don’t want to disparage monads. They can be very useful. For example, I know of someone who saved his company a lot of money by consolidating a menagerie of inconsistent projects and imposing a monadic framework to make everyone play nicely together. However—and I think this is telling—he was careful to not use the word “monad.” As I’ve written about before, category theory concepts like monads are often most useful behind the scenes.
Regular expressions
This post is the background for my previous post on regular expressions. I didn’t want to say regular expressions aren’t hard; a lot of people clearly do find them hard. Instead, I wanted to focus on why they’re hard, and give my perspective on perceived reasons and more fundamental reasons.
Unicode
Unicode is similar to regular expressions in that some people find it trivial and some find it maddeningly difficult. Both are right. Unicode can be trivial. The vast majority of pages on the internet use Unicode, specifically UTF-8 encoding. You’re reading Unicode right now. What’s so hard about that?
At its core, Unicode simply assigns numbers to characters, just as ASCII did. In a sense, Unicode is trivial. But it attempts to capture all human writing systems, and writing systems are complicated. As with regular expressions, it’s the peripheral issues that bring the complexity. Unicode is subtle because human language is subtle.
I define (informally) the /profundity index/ of a solution as the difficulty of coming up with it the first time, times the difficulty of devising the best available explanation of it, divided by the difficulty of understanding it once it’s explained that way. So if it was really hard to come up with, and then really hard to find a good explanation, but now its explanation makes it seem really obvious, it’ll have a very high profundity index. For monadic programming, though, the denominator doesn’t seem all that small; so the question is, have we just not yet found that really lucid explanation? Because if we do finally find a lucid explanation, it will have been really difficult to find and we’ll end up with quite a large profundity index; but as long as we haven’t found it yet, we don’t know we ever will.
That’s because everybody explain it badly,starting by calling it “monad” instead of “anything that have a flatMap operator”(or whatever is called in your programming language).
And if you didn’t heard of flatMap,they start by showing you the type signature instead of actual,concrete examples like the one for lists