Maybe it’s just hard

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.