我应该尝试将 F# 与 MVC3 和 ASP.net 结合使用吗?
我正在做一个新的合同项目。通常我使用 c# asp.net 和 razor。问题是,我的投资组合说。 C# C# C# C# 一遍又一遍。我认为就投资组合而言,增加一点多样性可能会有所帮助。另一方面,函数式语言似乎是一种有趣的方法,因为就控制器而言,asp.net MVC3 是非常面向函数的。那么,有没有人尝试过使用 F# 来实现此目的,结果是有帮助还是只是碍事?
我问,因为控制器似乎受益于功能性,而模型似乎受益于面向对象的语言。
I am working on a new project for contract. Usually I go with c# asp.net and razor. The problem is, my portfolio says. C# C# C# C# over and over. I figure portfolio wise it may be helpful to have a little more variety. The other side is, a functional language seems to be an interesting approach since asp.net MVC3 is very function oriented as far as the controllers are concerned. So, has anyone tried using F# for this and did it turn out to be helpful or just get in the way?
I ask, because the controllers seem to benefit from being functional, while the models seem to benefit from an object oriented language.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我编写了一些混合使用 MVC3 和 F# 和 C# 的示例,它运行得很好,我还创建了一个可以用作起点的模板(该模板很快就会出现在 Visual Studio Gallery 上):
在模型/控制器的实现中使用 F# 有一些好处:
)令人烦恼的是,当前版本的 F# 对 LINQ 的支持有点有限(编写具有大量联接和分组的复杂查询并不容易)。但是,如果您要调用存储过程,则可以很好地使用动态运算符(例如,请参阅此博客文章< /a>)。
(我还写了一些关于此的文章尚未发表 - 如果您给我发电子邮件 [电子邮件受保护])
I wrote some examples of using MVC3 with a mix of F# and C# and it works quite well and I also created a template that can be used as a starting point (which should appear on Visual Studio Gallery soon):
There are some nice things about using F# in the implementation of model/controllers:
A slightly annoying thing is that the support for LINQ in the current version of F# is a bit limited (writing complicated queries with lots of joins and grouping isn't easy). However, you can nicely use dynamic operator if you're calling stored procedures (see for example this blog post).
(I also wrote some articles about this that are not published yet - I can send you a draft if you drop me an email at [email protected])