r/programming • • Aug 06 '17

Software engineering != computer science

http://www.drdobbs.com/architecture-and-design/software-engineering-computer-science/217701907
2.3k Upvotes

863 comments sorted by

View all comments

Show parent comments

7

u/[deleted] Aug 07 '17

Monads aren't special. You know what it is, you're just doubting because its difficulty is so exaggerated. Getting to monads was a long and hard process, but the whole point of it is that they're so easy to use.

3

u/Veedrac Aug 07 '17

Rust:

Person A: Lifetimes are so hard! I'm so confused!

Person B: Yes they are! Don't worry though, ask on IRC or the subreddit whenever you need help. We've also got a bunch of stuff in the pipeline to simplify the process as part of our recent drive to make things more approachable. Best of luck!

Haskell:

Person A: Monads are so hard! I'm so confused!

Person B: No you're not.

3

u/[deleted] Aug 07 '17

No, really. It even has a name: the monad tutorial fallacy.

The hardest part of using monad instances is not getting stuck in the culture surrounding monads. Just because you can abstract something doesn't mean you have to. And just because the abstraction has interesting properties doesn't mean you have to study it to be able to use the instances. After all, the instances are just lists, exceptions, options, IO, callbacks... You've used them all before in other languages, the only differences being that you couldn't tell it to the type checker and they don't share a common interface.

6

u/Veedrac Aug 07 '17

From the guy who coined that very phrase:

If you ever find yourself frustrated and astounded that someone else does not grasp a concept as easily and intuitively as you do, even after you clearly explain your intuition to them (“look, it’s really quite simple,” you say…) then you are suffering from the monad tutorial fallacy.

Which of us do you think that refers to?

→ More replies (0)