News for hackers. Stuff that matters.
Re:Scala's Option monad versus null-conditional operator in C# by jameslk on Saturday February 20, 2016 @04:51PM (#11142111)
Why not just use less dots to begin with? Or, in other words, apply the Law of Demeter[0]. To me, diving so many levels deep into dependencies is a code smell because it tightly couples code to sub-dependencies and makes refactoring more difficult.

0. https://en.wikipedia.org/wiki/Law_of_Demeter

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:

http://c2.com/cgi/wiki?LawOfDemeter

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.