4 ms·
API's are the same for F# and C#, so it should be trivial to translate the code examples from C# into F#. Just remove the curly braces and change "var" into "le
by goto11 6y ago
API's are the same for F# and C#, so it should be trivial to translate the code examples from C# into F#. Just remove the curly braces and change "var" into "let".
- rishav_sharan 6y agotwo problems here; 1. For a new comer to the language, this is still too much of a hurdle. 2. If I wanted to use F# only as a proxy for C#, then I would rather use C#. I want to write F# code in a functional first and idiomatic way. This is the stock answer I have gotten in the .Net Community and as someone who wants to use F# for web apps, its a huge turn off. There are pretty much no tutorials, no recent articles and no performant native F# libraries out there. There is no push from MS to improve the situation. and the community is like - This is fine! Expecting a new user to write c# code with "let" isn't going to fix that.
- piaste 6y ago> There are pretty much no tutorials, no recent articles and no performant native F# libraries out there. Giraffe [1] is the de facto standard F# web framework. It's a plugin on top of ASP.NET (for all the reasons described elsewhere - performance, security, ecosystem) that lets you write functional-style 'route >=> function' code without controllers. If you want a more batteries-included approach, Saturn [2] builds on top of Giraffe to provide, well, more backend batteries (database layer, etc.) Finally, the SAFE stack [3] are a set of project templates that combine the above with a F# frontend (via the Fable JS compiler) and some Azure deployment helpers. [1] https://giraffe.wiki/docs https://giraffe.wiki/docs [2] https://saturnframework.org https://saturnframework.org [3] https://safe-stack.github.io/ https://safe-stack.github.io/
- oaiey 6y agoF# deserves more love in their communication. Definitely. F# appeals to many, however, from a product management perspective (aka MS perspective) there is a ratio of 100 C# dev to 1 F# devs (MS showed statistics once on it). Also, F# is community owned to my understanding (up to the statement of a MS Research Employee and F# inventor Don Syme to say that the "Microsoft." prefix on ASP.NET Core are not open source community friendly) while C# is 100% design & developed by MS. Which - IMHO - makes it very delicate for Microsoft to communicate well here.
- pjmlp 6y agoThey also have a few high profile personalities that are pretty much into the "us vs them" towards C# developers and Microsoft, which turns off many enterprise developers to even bother with F#.
- mdpm 6y agoThis would remove the benefit of functional idioms, and mitigate any advantages the differing approaches have. F# and C# and not just syntactically different.
- goto11 6y agoTrue, but the code examples in the BCL documentation is to show how to use the API, not to teach the languages. See something like F# for Fun and Profit https://fsharpforfunandprofit.com/ https://fsharpforfunandprofit.com/ to learn to write idiomatic F#. More F# documentation and support from MS would be great, but IMHO F# examples in the BCL documentation would not be the best use of resources.