Re:Technology Change: .Net to Scala
by flipchart on Friday October 25, 2013 @10:10AM
(#6611676)
I agree with you on the functional style. C#'s LINQ solves this problem quite well, although they named them differently (map -> select, filter -> where, reduce -> Aggregate). I've seen a number of people laud C# for being functional-ish because of such features.
[ Parent
| on HN ]
LINQ is a fantastic DSL akin to Scala's collection types. Odersky gives C# the nod as one of the few other traditionally imperative languages to have such a rich way of transforming data in his Functional Programming with Scala coursera course.
I do prefer Scala's collection types and for comprehensions over LINQ though. I find them much easier to read and more powerful.
You are explaining it a bit wrong. C# provides delegates (Action, Func etc.), lambda expressions, expression trees, anonymous functions, anonymous types, extensions methods. Those features make it a functional language and make succinct monads possible. LINQ happens to be one of those monads, but you can implement yours (e.g. rename Select to map etc.).