Should I try F # with MVC3 and ASP.net?

I am working on a new draft contract. I usually use C # asp.net and a razor. The problem is in my portfolio. C # C # C # C # over and over again. I think the portfolio is wise, it may be helpful to have a little more variety. The other side - the functional language seems to be an interesting approach, since asp.net MVC3 is very function-oriented with respect to controllers. So, did anyone try to use F # for this, and it turned out to be useful or just bothering you?

I ask because controllers seem to benefit from functionality, while models seem to benefit from an object-oriented language.

+8
f # asp.net-mvc-3
source share
1 answer

I wrote some examples of using MVC3 with a combination of F # and C #, and it works very well, and I also created a template that can be used as a starting point (which should appear in the Visual Studio gallery soon):

There are some good things about using F # in model / controller implementations:

  • F # types, such as records, simplify the implementation of a domain model
  • You can also use F # asynchronous workflows to implement asynchronous controllers (see this snippet )

A little annoying is that LINQ support in the current version of F # is a bit limited (writing complex queries with a lot of joins and groupings is not easy). However, you can use the dynamic operator if you call stored procedures (see, for example, this blog post ).

(I also wrote some articles about this that have not yet been published - I can send you a draft if you write me an email at tomas@tomasp.net)

+9
source share

All Articles