News for hackers. Stuff that matters.
Re:Being a polyglot programmer by nahname on Tuesday November 06, 2012 @10:05AM (#4748666)
I learned java in school and used C# professional for year. Almost every useful refactoring I perform in C# is based on functional concepts. You can slap patterns on a mess to provide order or you can introduce functional concepts to remove it, almost entirely.

I am not trying to dismiss patterns, but when you have lambda's you have a free way to add a visitor, command or specification to your code. It is one line instead of three interfaces and a bunch of shared understanding.

Consider,

var even = (new [1,2,3,4]).Select(x => x % 2 == 0);

The select statement gives you a way to interrogate individual objects, in the same way you could if you built up all the plumbing for a visitor pattern. What did I have to add to do this? Nothing. C# is awesome.

Re:Being a polyglot programmer by bbotond on Tuesday November 06, 2012 @11:59AM (#4749272)
Isn't it new[]{1,2,3,4}? Or is this some new syntax I don't know about?
Re:Being a polyglot programmer by nahname on Tuesday November 06, 2012 @12:32PM (#4749434)
No, you posted the correct form. Mine would have a compile error.