Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Drawbacks of developing ASP.NET and ASP.NET MVC apps in F#?

I would like to try developing ASP.NET and ASP.NET MVC apps in F#. I enjoy using functional langauges, and to my mind the functional paradigm fits better with HTTP and the web than imperative programming (though of course F# can do both).

I am only intending on trying F# for some personal projects, though I hope that eventually F# will be seen as a valid alternative to C# for suitable commercial ASP.NET projects.

What pitfalls and rough edges are there currently for using F# with ASP.NET? One obvious disadvantage is that F# is much more obscure than C#, so there are less code samples and experienced programmers for F#.

What other potential issues should I be aware of?

like image 584
ctford Avatar asked Nov 25 '09 12:11

ctford


2 Answers

Personally I am a big fan of F#. My NDjango parser/rendering engine is written in F#.

But trying to do everything in F# can be difficult. To add to your list of the things which are not there yet:

  • There is no support for visual designers - neither webforms nor winforms. You can write the appropriate code manually, of course

  • No Code Completion

  • Debugging in F# can be a challenge, in particular because of anonymous closures

  • Compiler Diagnostics can be misleading because of type inference - one typo can have profound impact in far away places

  • My biggest pet peeve is the 'file order matter' rule. You have to specify the order in which the files will be compiled

By no means this is a complete list. On the other end one might hope that some of these points will be addressed in final release.

Despite of all of the listed (and unlisted) problems I enjoy programming in F# - sometimes it gives a very refreshing perspective on the coding and I already started using some of the tricks inspired by F# in my C# code.

Just do not go crazy in it

like image 132
mfeingold Avatar answered Oct 10 '22 21:10

mfeingold


Is this a home project or a work thing? If it's for work, you need to consider the ability of somebody else to drop in and maintain your code - there aren't too many F# developers out there when compared to competent C# people.

like image 42
Paddy Avatar answered Oct 10 '22 20:10

Paddy