3 ms·
> They just aren't easy because most people don't have the base of terminology That's like saying a giant, complex library with a nice, tight API is 'simple'.
by smallnamespace 10y ago
> They just aren't easy because most people don't have the base of terminology
That's like saying a giant, complex library with a nice, tight API is 'simple'. It's not, the complexity is just hidden.
Same thing with monads. Once you understand some of the machinery of category theory, or really grok functional programming, then yes, monads are 'simple', but all the complexity lies in getting there.
- kccqzy 10y agoI think you're confusing complexity with learning curve. Complex things can be made easy to learn, if, for example, you have "a nice, tight API." Monads are the opposite. They are simple things that are difficult to learn.
- smallnamespace 10y agoWhy would something be difficult to learn if there wasn't complexity underneath it? There are lots of things that are simple to state, like the fundamental theorem of algebra, but the machinery behind it is complex.
- chousuke 10y agoA simple thing can be difficult because understanding why it works may be nontrivial. However, it remains simple (by definition) if understanding is not affected by complecting factors such as side-effects or the global state of the system. A pure function is always simple, even if it implements a difficult algorithm. I hold the opinion that complicated things can never be truly easy: they can only have the appearance of ease until there comes a time that you must understand all the complexity.
- kazagistar 10y agoBecause it is far away from what you already know. Haskell is a fairly simple language, but it very difficult to learn compared to a language I would consider much more complex like Java, because you cannot reuse as much of what you have learned from other languages. All the monad implementations are just a few simple lines of code, and understanding monad is just a matter of reading a few, reading the rules, and doing enough with them until their utility clicks. However, the type of abstraction they are and the way they are used are very different from the programming you are used to that they seem harder to learn.
- kccqzy 10y agoI'll provide an example in math. Linear algebra is much simpler than calculus. Yet we teach high school students calculus but not linear algebra. Why? Because a lot of the complexity in calculus can be hidden away behind some hand-wavy definition of a limit and consider basically only smooth functions. That way, we have engineered our math classes to avoid the complexity underneath, and we have high school students finding calculus to be easy to learn.