News for hackers. Stuff that matters.
Re:Technology Change: .Net to Scala by karterk on Friday October 25, 2013 @10:04AM (#6611638)
I can't talk too much about C#, but in Java there is no first class support for `map`, 'filter`, `reduce` etc. (with Google's Guava, you can imitate these things, but not so elegantly). So transforming a data structure involves a for-loop and lots of mutable operations. Iterating and transforming a collection in a functional style is much nicer.
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.
Re:Technology Change: .Net to Scala by seglo on Friday October 25, 2013 @12:24PM (#6612564)
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.

Re:Technology Change: .Net to Scala by _random_ on Friday October 25, 2013 @04:38PM (#6614433)
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.).
Re:Technology Change: .Net to Scala by flipchart on Saturday October 26, 2013 @02:01AM (#6616538)
Yes I agree with you. I'm not as well versed in monads and the technicalities around them as I would like to be, so thank you for pointing that out!