简体   繁体   中英

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?

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

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.

mmmmm f#, the other white meat that dare speak its name. Go for it, F# as Mr Kay would say "its the future!". As for the pitfall...puh!, what pitfalls, you just create stuff that works without chuff and Objects.

C# is great and it has its place. But as you correctly pointed out it does not suite web programming. In that matter neither does the event smoke and mirrors that ASP.net provides.

Go lower. Think HttpHandlers and REST. You don't need the MVC stuff. Its and Idea and not a product.

The front end GUI has nothing to do with the backend. Do you really need ASP.net? JSON/REST/POX.....develop your middle layer with these in mind and you should be ok. Stay away from WCF its propriety and nasty.

as for the comment of maintainable code. Trail blaze. why be what you don't want to be. If they don't think like you, then do you want them around?

When I work on projects the ideas drive the product not the technology and certainly not the masses or the mob. Large organizations cater for the mob for one reason only, and it has nothing to do with advancing the art and all about the Euro.

Messages and pipes are what I would use in this current climate. Events are great when the environment supports it, but does the async nature of the web lend itself to thinking of a processing pipe with clock ticks and checking if things have been done.

.Net good for one thing. middle layer with DB and logic. As for the front. Use something else. More webby.

Why just F# bring in the whole shooting match of best in class. plenty to choose from php, python, ruby,clojure, haskell etc....

F# is more than what it is, but what it represents, an old way of thinking in new and desperate times of multi-core multi-threading, multi-process.

As a song I once listened to said "I don't care about their different thoughts Different thoughts are good for me"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM