Object-Oriented Programmer: What's that?
FP: Read this math-heavy paper, and learn to write your whole program on one line!
OOP: No one can read your code.
FP: Category Theory!
OOP: (walks away)
I will now do you a favor, oh humble Object-Oriented Programmer:
A Monad is a special kind of Decorator that helps you deal with incomplete data and partial failures.
(Dear Functional Programmer: I understand you hate my definition. When you can provide an alternative without using the words "functor", "flatMap", or "category", or any math at all, then we'll talk.)
Now let's imagine how the conversation might go differently:
FP: Monads!
OOP: This helpful technique informs my OO code on a regular basis.
FP: Category Theory!
OOP: (smiles indulgently)
No comments:
Post a Comment