原文地址: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. sql 注入问题

    1. 关于使用intval强制转换成数字的问题.数字大于2147483647会出现溢出出现负数.使用个方法来替代这个吧$n="\n";$a=2147483648.05555;ech ...

  2. Oracle下批量将一个用户的所有表的select权限赋值给另外一个用户

    起因 为什么会有这篇文章呢? 因为最近在做项目的时候遇到一个问题...实际生产环境中程序datasource登陆的Oracle数据库用户user1不是我们创建的.这个用户没有访问我们业务表的权限(因为 ...

  3. PHP中Exception异常

    异常的基本使用 当异常被抛出时,其后的代码不会继续执行,PHP 会尝试查找匹配的 "catch" 代码块. 如果异常没有被捕获,而且又没用使用 set_exception_hand ...

  4. MyEclipse安装插件的几种方法

    本文讲解MyEclipse(MyEclipse10)的三种方法,以SVN为例 Eclipse update site URL: http://subclipse.tigris.org/update_1 ...

  5. eclipse SVN Android项目出错,程序老闪退

    百度得知是.so文件被SVN客户端默认为是链接后的文件,认为是不提交的.因此需要将.so文件手动添加到版本控制.

  6. 使用Cocos2d-x实现微信“天天爱消除”炫耀button特效

    引言Cocos2d-x引擎中有很多Action,这样可以方便的让开发者调用相应的Action去完成一些动作,例如:移动,弹跳,淡入淡出等.可在实际的开发过程中,由于游戏的需要,显然地,引擎自带的Act ...

  7. D3.js学习(五)

    上一节我们已经学习了如何设置填充区域,其实理解了他的实现原理还是非常简单了.这一节中, 我们主要学习多条曲线的绘制,以及给不同的曲线指定不同的纵坐标. 新的数据 由于我们要画两条曲线,所以我们要在原来 ...

  8. java.lang.ClassNotFoundException: com.mysql.jdbc.Driver解决办法

    这个问题的原因是没有导入mysql连接库,我从官网上下载后照着网上的教程各种导入无果,最后发现是我导入的文件错了.... 官网上下下来的压缩文件是这个,不过这并不是直接要导入的文件,首先解压文件,然后 ...

  9. Android插件化框架研究-DroidPlugin

    直接贴上我做的ppt.

  10. php模拟http请求的方法

    我在这里终结了三种方法 第一种方法:fsockopen $flag = 0; $post = ''; $errno = ''; $errstr = ''; //要post的数据 $argv = arr ...