News for hackers. Stuff that matters.
Re:Can you build a startup on .Net? by edwinnathaniel on Monday April 16, 2012 @06:20PM (#3849786)
That example is definitely looks great.

... and yes, as a Java developer, I use Guava once in a while and I do JavaScript as part of my job as well and I do appreciate first-class function.

Typically the problems that functional features solve are filtering and transformation and yet most often than not I happen to solve them at the SQL layer (be it JPQL or straight up SQL).

Re:Can you build a startup on .Net? by macca321 on Monday April 16, 2012 @06:58PM (#3849943)
Once you start thinking of your object model as data, you can do amazing things. Want to find all the types in your system that implement an interface and spin them up?

     var rules = 
		AppDomain.CurrentDomain.GetAssemblies
		.SelectMany(a => a.GetTypes())
   		.Where(t => typeof(ISecurityRule).IsAssignableFrom(t))
   		.Select(t => Activator.CreateInstance() as ISecurityRule)
   		.OrderBy(r => r.Priority);
You can then run a chain of responsibility by writing

    var allowed = rules.First(r => r.Check(someObject) != null);  
    //Check returns null when a rule isn't relevant to the object being checked
it's pretty sweet for metaprogramming when you can run queries against your codebase
Re:Can you build a startup on .Net? by edwinnathaniel on Tuesday April 17, 2012 @12:48PM (#3853511)
That is definitely sweet.

Java has AOP and extensively use Annotations (Attributes in .NET) and the approach there is definitely heavier than what you wrote above.