TypeScript VS ScriptSharp – 权衡是什么?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14751807/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
TypeScript VS ScriptSharp – What’s the tradeoff’s?
提问by SexyMF
I am about to build a large scale Javascript application and I want to build it in more structured way.
Jquery is will use for css effects.
The server side will be in c#.
Can you share your knowledge and experience, which is better?
我即将构建一个大规模的 Javascript 应用程序,我想以更结构化的方式构建它。
Jquery 将用于 css 效果。
服务器端将使用 c#。
你能分享你的知识和经验,哪个更好?
- Which one is more feature rich?
- Which is better documented?
- Is type script really strongly type?
- 哪个功能更丰富?
- 哪个更好地记录在案?
- 类型脚本真的是强类型吗?
Also, for the long run, ScriptSharp is one-man-show (As I understand it) and Typescript was built by Microsoft.
Thanks
此外,从长远来看,ScriptSharp 是单人秀(据我所知),而 Typescript 是由 Microsoft 构建的。
谢谢
回答by Fenton
Which one is more feature rich?
哪个功能更丰富?
Neither - the compiled JavaScript makes all of JavaScript available to you.
两者都不是 - 编译后的 JavaScript 使您可以使用所有 JavaScript。
Which is better documented?
哪个更好地记录在案?
Documentation is probably not the right question. Which has more information available / a strong community to help you when you get stuck? As of now, there are 141 ScriptSharp questions (with 48 followers) on Stack Overflow and 623 TypeScript questions (with 328 followers).
文档可能不是正确的问题。哪个有更多可用信息/强大的社区可以在您遇到困难时为您提供帮助?截至目前,Stack Overflow 上有 141 个 ScriptSharp 问题(有 48 个关注者)和 623 个 TypeScript 问题(有 328 个关注者)。
TypeScript has a very clear language specification. I had a look for the documentation on ScriptSharp - someone will need to point out where this is... I assume there is a sub-set of C# you can use and I would be interested in knowing what that sub-set is.
TypeScript 有一个非常清晰的语言规范。我查看了有关 ScriptSharp 的文档 - 有人需要指出这是哪里...我假设有一个 C# 子集您可以使用,我很想知道该子集是什么。
Is TypeScript really strongly typed?
TypeScript 真的是强类型的吗?
TypeScript is statically typed. It will check types at compile-time (and IDEs will check at design-time). Errors will be generated for type violations, although you can also opt to have dynamic typing also if you want to.
TypeScript 是静态类型的。它将在编译时检查类型(IDE 将在设计时检查)。类型违规会产生错误,尽管您也可以根据需要选择动态类型。
Which one should I use?
我应该使用哪一种?
If you can't bear the thought of writing code in anything other than C#, you should use ScriptSharp. In all other cases, I recommend TypeScript. Understanding JavaScript is beneficial given how the language is so ubiquitous and TypeScript gives you early access to ECMAScript 6 language features, so if you decided to ditch everything and use pure JavaScript, your TypeScript coding experience will be more valuable.
如果您无法忍受使用 C# 以外的任何语言编写代码的想法,那么您应该使用 ScriptSharp。在所有其他情况下,我推荐 TypeScript。了解 JavaScript 是有益的,因为该语言是如此普遍,并且 TypeScript 可以让您尽早访问 ECMAScript 6 语言功能,因此如果您决定放弃一切并使用纯 JavaScript,您的 TypeScript 编码经验将更有价值。
I am biased, in a way. I like TypeScript so much I wrote a book on it. However, the enthusiasm for TypeScript (rather than Dart, CoffeeScript, ScriptSharp) preceded that project.
在某种程度上,我有偏见。我非常喜欢 TypeScript,因此写了一本书。然而,在该项目之前,人们对 TypeScript(而不是 Dart、CoffeeScript、ScriptSharp)充满热情。
回答by guruprasath
ScriptSharp has been under constant development though it is a one-man show. We have been using ScriptSharp for a large scale web application for close to 3 years now and it has served us well. Ability to write code in C# has helped us move quickly and we have had lesser training overhead.
ScriptSharp 虽然是单人秀,但一直在不断发展。近 3 年来,我们一直在将 ScriptSharp 用于大型 Web 应用程序,并且它一直为我们服务。使用 C# 编写代码的能力帮助我们快速行动并且我们减少了培训开销。
There is a clear downside to ScriptSharp that when the new versions release, there are a lot of breaking changes in some versions. But we like it so much that we are willing to put up with the breaking changes and make our changes accordingly.
ScriptSharp 有一个明显的缺点,即在新版本发布时,某些版本有很多破坏性变化。但是我们非常喜欢它,以至于我们愿意忍受破坏性的变化并相应地做出改变。
If you have a dedicated infrastructure team to handle such architectural changes, you can use them to keep up with ScriptSharp and write the wrappers for the javascript libraries, I highly recommend ScriptSharp based on our experience. Please evaluate a simple prototype in both before you decide on which technology to go with. You can also try Sharpkit for an interesting alternative. Link-> http://sharpkit.net/
如果您有专门的基础架构团队来处理此类架构更改,您可以使用它们来跟上 ScriptSharp 并编写 javascript 库的包装器,根据我们的经验,我强烈推荐 ScriptSharp。在决定采用哪种技术之前,请评估两者中的简单原型。你也可以试试 Sharpkit 一个有趣的选择。链接-> http://sharpkit.net/
回答by user1215284
I am looking into this as well and from my research it appears that Microsoft has used Script# to build the front end of all of their large web apps like Office Web Apps, Hotmail, Office 365, SharePoint 2013, and they are using older versions than the most recent release of Script# because people are saying that it is stable enough as it is. The problem is that Microsoft seems to be keeping this productivity tool from us by not releasing the Script# definition files (import libraries) to the public for things like SharePoint, CRM, and Office so it seems that most people are moving towards TypeScript instead. I however am leaning towards using Script# and building the definitions that I need as I need them.
我也在调查这个,从我的研究来看,微软似乎使用 Script# 来构建他们所有大型网络应用程序的前端,如 Office Web Apps、Hotmail、Office 365、SharePoint 2013,并且他们使用的是旧版本比 Script# 的最新版本,因为人们说它已经足够稳定了。问题在于,微软似乎通过不向公众发布用于 SharePoint、CRM 和 Office 之类的 Script# 定义文件(导入库)来阻止我们使用此生产力工具,因此似乎大多数人正在转向 TypeScript。然而,我倾向于使用 Script# 并根据需要构建我需要的定义。
References:
参考:
Getting Started: http---scriptsharpcontrib.codeplex.com/wikipage?title=Getting%20started%20with%20ScriptSharp
入门:http---scriptsharpcontrib.codeplex.com/wikipage?title=Getting%20started%20with%20ScriptSharp
Oh and there is a CRM definition on Codeplex but I am out of links :)
哦,Codeplex 上有一个 CRM 定义,但我没有链接:)
回答by sucaba
If you are .net developer then definitely you should at least check script#. Yes, it is one-man show. Yes, it is not as advertised as TypeScript but can many developers around compete with MS logo?
如果您是 .net 开发人员,那么您绝对应该至少检查 script#。是的,这是一个人的表演。是的,它不像 TypeScript 那样宣传,但是周围的许多开发人员可以与 MS 徽标竞争吗?
I have practical experience with Script# but not with TypeScript. And the only reason why don't want to touch later is that script# is applicable for people already familiar with c#+JS while TypeScript is a completely new story and a new cost for your project.
我有 Script# 的实际经验,但没有 TypeScript 的经验。而后不想碰的唯一原因是 script# 适用于已经熟悉 c#+JS 的人,而 TypeScript 是一个全新的故事和新的项目成本。