flatMap is general, not specific to Option, so when someone said that flatMap is too hard for Java Joe I wasn't thinking of Option.flatMap, but:
List.flatMap Range.flatMap Option.flatMap Future.flatMap etc.flatMap C# has the same null problems as Java, sure. It has a 'nullable' syntax but that only applies to structs (direct values, not reference types). On Mon, Aug 6, 2012 at 2:13 AM, clay <[email protected]> wrote: > By itself, Option and flatMap are pretty simple, even for "Joe Java" > types. But even though it's simple to study and learn in isolation, one > could argue that it grows the barrier of entry to the language. New > programmers don't like to hit a huge wall of multiple foreign constructs > and syntaxes. Practical programmer types aren't dumb, but they often have > very limited patience for learning things that don't have clear upfront > practical value. The highly intelligent science/engineering communities > have rallied around conceptually simple languages like R/Matlab/Python > because they lack patience/interest in the fancier programming concepts. > > C# does have fancier functional functionality such as LINQ, but it's done > in a way where C# devs can use as much or as little as they choose, so > there's not an adoption barrier. In Scala (and I believe F# as well), > Option is pervasive across the language. Scala programmers are free to > write their own code using regular null, but generally, that's not the > Scala way, and it's so widely used in the core Scala libraries and in third > party Scala APIs that it would be hard to avoid. On the null issue, C# uses > plain null like Java or Groovy without an Option construct and without > compiler-level null type guarantees like Kotlin. > > There are many good strategies for improving the null issue: > > - No null (Haskell) > - Better null handling shorthand such as the colescing/elvis and safe > navigation operators > - Option class that works well with lambda expressions > - Static Compiler Null type safety (Kotlin and some annotation based > systems) > > On Sunday, July 29, 2012 7:54:34 PM UTC-5, Ricky Clarkson wrote: >> >> Incidentally, flatMap is called SelectMany in C#, and is apparently used >> without any real problem. Are our C# cousins that much more advanced? >> >> -- > You received this message because you are subscribed to the Google Groups > "Java Posse" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/javaposse/-/a5XYV-YKwDAJ. > > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/javaposse?hl=en. > -- You received this message because you are subscribed to the Google Groups "Java Posse" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
