Re:Scala's Option monad versus null-conditional operator in C#
by daxfohl on Saturday February 20, 2016 @06:32PM
(#11142487)
This is important for typical OO chaining
i.e. you should avoid:
serviceX.getServiceY().getServiceZ().getSomeValue();
But for just structured data it's not constructive to write accessor wrappers at each level. And for things like recursive data structures, it's not even possible.
Re:Scala's Option monad versus null-conditional operator in C#
by oofabz on Saturday February 20, 2016 @09:56PM
(#11143082)
More about the Law of Demeter at Ward's Wiki:
Re:Scala's Option monad versus null-conditional operator in C#
by lmm on Sunday February 21, 2016 @03:44AM
(#11143823)
Monads are very useful for what OO people sometimes call "cross-cutting concerns" - something that's relevant at many levels but not the primary purpose of any one function. E.g. error handling, async, audit logs, database transaction boundaries.
0. https://en.wikipedia.org/wiki/Law_of_Demeter