简体   繁体   中英

Getting started with ASP.NET using F#?

Hai guys,

  • Where should i start before using F#?

  • What are the Learning curves in F#?

  • What should developers moving from C# watch out for when they move to F#?

Tomas Petricek的“ F#web工具包 ”是一个使用F#进行asp.net开发的有趣例子。

In addition to what was already mentioned, I wrote a brief article which explains how to use F# in standard ASP.NET applications . Unfortunatelly, the sample application is no longer available as part of the F# distribution :-(. You can also try using F# with the ASP.NET MVC framework (which is somewhat simpler than standard ASP.NET web forms, but is less component-oriented). I don't have any definite link, but googling for "F# asp.net mvc" should do the trick.

You might want to take a look at IntelliFactory's WebSharper project at IntelliFactory.com .

It's main purpose is to grant the programmer with the ability to use only one language (F#) to develop a website and also to grant built-in tools for making the webprogrammers' life simpler (eg formlets and flowlets).

As for learning F# I'd recommend you the book Expert F#.

Moving from C# to F# can be difficult not only because of the syntactic differences, but because of moving from imperative programming to functional programming. If you want to follow functional programming in F#, you should get used to immutability, pure functions, workflows (monads in Haskell) and similar concepts. Expert F# for example can show and teach you examples, but I'm quite sure Google can also help.

I like what Robert Harvey proposed and what Tomas added. I am new to F# too and I would like to comment on the three bullets, which refer prior to ASP.NET + F# by simply asking for a 101 in F#.

You will definitely need some theoretical foundation before diving into F#. Erik's 13-episode Lecture, in Channel 9, is the best place to start

C9 Lectures: Dr. Erik Meijer - Functional Programming Fundamentals

F# isn't the quick and dirty way, nor the quick and reusable way we learned via oop design patterns. I think that you should take some time to embrace some of the basics. Afterwards, a good book like Tomas's (still waiting the hard copy here in Greece... grrrr :P) and writing alongside, some little code to get used with eg, currying and other aspects, is what you need. My estimation of the learning curve depends in your mathematical background. Even if you haven't got any clue about functional programming, if for example you come from a Computer Science uni you will struggle your way through wisdom pretty soon ;););)

And then you will enjoy the F# in Business Line Applications and improve your C# code too!!!!

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