您将 f# 用于哪些代码区域? [英] What areas of code are you using f# for?

查看:15
本文介绍了您将 f# 用于哪些代码区域?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于那些在使用 f# 的人,您使用它编写哪些功能领域的代码?这种语言真正适合什么语言,它比 c# 更强大和更容易做什么?

For those of you out there who are using f#, what areas of functionality are you coding with it? What is the language really well suited to and what does it do with far more power and ease than say c#?

推荐答案

我目前正在使用 F# 开发我的下一个独立视频游戏.到目前为止,我发现我的正常 OO 方法与我在 c# 中的开发方式不同.

I'm currently using F# to develop my next indie video game. So far I'm finding that my normal OO approach is different from how I develop in c#.

我注意到的一些好处是,我平均使用较小的函数,即每个函数的行数减少了.现在对我来说,将静态私有成员函数的范围限定在另一个成员内部,而不是让它暴露给对象中的所有内容,这也更加自然.编写碰撞算法真的很容易.我现在说用 F# 编写算法更容易还为时过早,但我已经倾向于那样做.

Some good things I've noticed is that I'm using smaller functions on average ie the number of lines per function is way down. It's also more natural now for me to scope a static private member function to be inside of another member instead of having it be exposed to everything in the object. Writing a collision algorithm was really easy. It's a bit early for me to say that writing algorithms in F# is easier but I'm already leaning that way.

自从我开始使用 F# 以来,并不是所有的事情都如鱼得水.我仍然发现缺少在线文档.专家 F# 有一些帮助,但由于它略过面向对象,这让我迷失了很多次.当面向对象是目前最流行的开发形式时,作者选择不深入研究 OO,这让我很紧张.我不想抛弃 OO.我希望将功能集成到其中.

Not everything has been roses since I started using F#. I'm still finding online documentation lacking. Expert F# has been of some help but since it skims over OO it leaves me lost a lot of times. It gets on my nerves that the author chose not to go very deep into OO when it's currently the most popular form of development. I'm not looking to dump OO. I'm looking to integrate functional into it.

迄今为止我所看到的最大优势是我的代码正确性.我知道这听起来很有趣,但每次我编译代码时,它都按预期工作.希望我破万行代码标记后,情况仍然如此.

The biggest advantage I've seen so far has been my codes correctness. I know it sounds funny but every time I've gotten my code to compile, it has worked as expected. I hope this is still the case when I break the ten thousand lines of code mark.

这篇关于您将 f# 用于哪些代码区域?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆