原文地址:http://fsharpforfunandprofit.com/why-use-fsharp/

Why use F#?
Why you should consider using F# for your next project

为什么要用F#?
为什么你应该考虑在下一个项目使用F#

Although F# is great for specialist areas such as scientific or data analysis, it is also an excellent choice for enterprise development. Here are five good reasons why you should consider using F# for your next project.
F#不仅仅在科学和数据分析这类专业领域很适用,对于企业开发来说它也是个很好的选择。以下是为什么你应该考虑在下一个项目使用F#的五个原因。

Conciseness
F# is not cluttered up with coding "noise" such as curly brackets, semicolons and so on.
You almost never have to specify the type of an object, thanks to a powerful type inference system.
And, compared with C#, it generally takes fewer lines of code to solve the same problem.
简洁
F#不会被大括号、分号等代码“杂音”弄得乱七八糟。
多亏强大的类型推导系统,你几乎不需要指定对象的具体类型。
并且,相对于C#,它通常只用更少的代码就能解决同样的问题。

Convenience
Many common programming tasks are much simpler in F#. This includes things like creating and using complex type definitions, doing list processing, comparison and equality, state machines, and much more.
And because functions are first class objects, it is very easy to create powerful and reusable code by creating functions that have other functions as parameters, or that combine existing functions to create new functionality.
方便
一些常见的编程任务在F#里非常简单。例如:创建和使用一个复杂的自定义类型,处理列表,比较,状态机等等。
并且,由于函数是"第一等公民",所以可以通过创建函数的方式,来轻松的编写强大可重用的代码,创建函数时,可以用其它函数作为参数,或者合并已有的函数来创造新的功能。

Correctness
F# has a powerful type system which prevents many common errors such as null reference exceptions.
Values are immutable by default, which prevents a large class of errors.
In addition, you can often encode business logic using the type system itself in such a way that it is actually impossible to write incorrect code or mix up units of measure, greatly reducing the need for unit tests.
正确
F#有一个强大的类型系统,可以预防例如空指针应用之类的常见错误。
值默认是不可变的,也可以预防一大类的错误。
此外,你还可以使用类型系统本身对业务逻辑进行编码,这样就不可能写出不正确的代码,或者混淆度量单位,大大降低了对单元测试的需求。

Concurrency
F# has a number of built-in libraries to help when more than one thing at a time is happening. Asynchronous programming is very easy, as is parallelism. F# also has a built-in actor model, and excellent support for event handling and functional reactive programming.
And of course, because data structures are immutable by default, sharing state and avoiding locks is much easier.
并发
F#有一些内置的库来帮助处理多件事同时发生的情况。因为并发,异步编程也很简单。F#还内置了一个actor模型,对事件处理和反射式编程也有很好的支持。
当然,因为默认情况下数据结构是不可变的,共享状态和避免锁也容易得多了。

Completeness
Although it is a functional language at heart, F# does support other styles which are not 100% pure, which makes it much easier to interact with the non-pure world of web sites, databases, other applications, and so on. In particular, F# is designed as a hybrid functional/OO language, so it can do virtually everything that C# can do.
Of course, F# is part of the .NET ecosystem, which gives you seamless access to all the third party .NET libraries and tools. It runs on most platforms, including Linux and smart phones (via Mono).
Finally, it is well integrated with Visual Studio, which means you get a great IDE with IntelliSense support, a debugger, and many plug-ins for unit tests, source control, and other development tasks. Or on Linux, you can use the MonoDevelop IDE instead.
完备
尽管F#的核心是函数式编程语言,但是它并不是百分百的纯函数式,F#支持其它的编程范式,这样可以让它更方便的与web网站、数据库、其它应用等进行交互。特别是F#被设计成一个混合性/面向对象的编程语言,所以它几乎可以做所有C#能做的事。
当然,作为.NET生态系统的一部分,F#可以无缝连接所有的第三方.NET库和工具。他可以运行在包括Linux和智能设备在内的大部分系统平台。
最后,它与VS高度集成,意味着你可以得到强悍的智能感知,调试器,以及各种单元测试、代码版本控制之类的插件等等。在Linux平台,你也可以使用MonoDevelop来作为IDE。

F#之旅1 - Why use F#?为什么要用F#?的更多相关文章

  1. F#之旅4 - 小实践之快排

    参考文章:https://swlaschin.gitbooks.io/fsharpforfunandprofit/content/posts/fvsc-quicksort.html F#之旅4 - 小 ...

  2. F#之旅0 - 开端

    F#之旅0 - 开端 UWP的学习告一段落,CozyRSS的UWP版本并没有做.UWP跟wpf开发几乎一模一样,然后又引入了很多针对移动设备的东西,这部分有点像android.没啥太大的意思,不难,估 ...

  3. F# 之旅(上)

    写在前面的话 解答一下在上一篇文章<在Visual Studio中入门F#>中有人的提问, 1. 问:是准备写 F# 系列吗?    答:当然不是,本人也是刚刚学习 F#,只是翻译微软官方 ...

  4. F# 之旅(下)

    写在前面的话 学习 F# 一定要去体会函数式编程的特点,推荐一下阮一峰的日志<函数式编程入门教程>. 在这篇文章中 递归函数 记录和可区分联合类型 模式匹配 可选类型 度量单位 类和接口 ...

  5. F#之旅3 - F# PK C#:简单的求和

    原文链接:https://swlaschin.gitbooks.io/fsharpforfunandprofit/content/posts/fvsc-sum-of-squares.html Comp ...

  6. F#之旅9 - 正则表达式

    今天,cozy群有个群友发了条正则,问正则匹配相关的问题.虽然他的问题用html selector去处理可能更好,但是我也再一次发现:我忘了正则怎么写的了! 忘掉正则是有原因的,这篇文章会简单记录下F ...

  7. F#之旅8 - 图片处理应用之动画二维码

    首先,先介绍下什么是动画二维码.前些天在网上闲逛,突然看到一个开源项目,发现一种二维码的新玩法.https://github.com/sylnsfar/qrcode/blob/master/READM ...

  8. F#之旅6 - 简单AV推荐系统

    上回说到用F#来写爬虫,这只是F#学习第一阶段的第一步.最开始,就对第一阶段做了这样的安排: 1.爬虫爬取AV数据 2.数据处理和挖掘 3.数据可视化(使用ECharts) 4.推荐系统 第一步很快就 ...

  9. F#之旅5 - 小实践之下载网页(爬虫基础库)

    参考文章:https://swlaschin.gitbooks.io/fsharpforfunandprofit/content/posts/fvsc-download.html 参考的文章教了我们如 ...

随机推荐

  1. ADO.NET--收藏整理别人的教程

    本文所有内容均从前辈的博客中收集整理而来,仅供自己学习参考的时候快速访问用. ADO.NET入门教程(一) 初识ADO.NET ADO.NET入门教程(二)了解.NET数据提供程序 ADO.NET入门 ...

  2. errored out in DoExecute, couldn't PrepareToExecuteJITExpression

    error: Couldn't materialize struct: size of variable <varName> disagrees with the ValueObject' ...

  3. 如何在latex 中插入EPS格式图片

    如何在latex 中插入EPS格式图片 第一步:生成.eps格式的图片 1.利用visio画图,另存为pdf格式的图片 利用Adobe Acrobat裁边,使图片大小合适 另存为.eps格式,如下图所 ...

  4. 【前端攻略】:玩转图片Base64编码

    引言 图片处理在前端工作中可谓占据了很重要的一壁江山.而图片的 base64 编码可能相对一些人而言比较陌生,本文不是从纯技术的角度去讨论图片的 base64 编码.标题略大,不过只是希望通过一些浅显 ...

  5. 在使用 vscode 时 eslint 检测 .vue 文件中的less 部分内容

    问题: 在使用 vscode 以及 eslint 来检测 基于 webpack 的 vue-cli 的项目中,eslint 无法检测到 .vue 文件中的less 部分内容. 解答: 1.通过 下载 ...

  6. Java优先队列

    按照Java api的说法: java.util.PriorityQueue.PriorityQueue() Creates a PriorityQueue with the default init ...

  7. 转载:Centos7 从零编译Nginx+PHP+MySql 二

    序言 这次玩次狠得.除了编译器使用yum安装,其他全部手动编译.哼~ 看似就Nginx.PHP.MySql三个东东,但是它们太尼玛依赖别人了. 没办法,想用它们就得老老实实给它们提供想要的东西. 首先 ...

  8. php简单框架的应用实例

    <html> <frameset rows="50%,50%"> <frame src="/Test/header.php"> ...

  9. 由表单验证说起,关于在C#中尝试链式编程的实践

    在web开发中必不可少的会遇到表单验证的问题,为避免数据在写入到数据库时出现异常,一般比较安全的做法是前端会先做一次验证,通过后把数据提交到后端再验证一次,因为仅仅靠前端验证是不安全的,有太多的htt ...

  10. 坑爹的微信支付v3,其实没有那么坑

    http://www.cnblogs.com/zskbll/p/wxpay.html 研究微信开发一年多了,每个新接口,都会第一时间进行研究.微信支付开放很久,一直没机会接触到支付接口,等了好久终于从 ...