TypeScript 或 CoffeeScript

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15172089/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 02:48:21  来源:igfitidea点击:

TypeScript or CoffeeScript

node.jscoffeescripttypescript

提问by started on node.js

Started using node.js for building web apps.

开始使用 node.js 构建 Web 应用程序。

One of my colleague asked about TypeScript which is a new Language from Microsoft. We have a plan to start our new Web app with node.js and TypeScript as a Scripting engine.

我的一位同事询问了 TypeScript,这是 Microsoft 的一种新语言。我们计划使用 node.js 和 TypeScript 作为脚本引擎来启动我们的新 Web 应用程序。

I just want to know is it right time to develop apps using TypeScript? How about the future of TypeScript?

我只想知道现在是使用 TypeScript 开发应用程序的合适时机吗?TypeScript 的未来如何?

回答by Nej Kutcharian

Both TypeScript and CoffeeScript have their own strengths. But if you want to build a big application I'd recommend going with CoffeeScript as you end up writing less code. Here's a nice slideshowthat compares both TypeScript and CoffeeScript. This may be off topic but the development of TypeScript is clear at least part of MS is really serious about open source.

TypeScript 和 CoffeeScript 都有自己的优势。但是,如果您想构建一个大型应用程序,我建议您使用 CoffeeScript,因为您最终会编写更少的代码。这是一个很好的幻灯片,比较了 TypeScript 和 CoffeeScript。这可能是题外话,但 TypeScript 的开发很明显,至少 MS 的一部分对开源非常认真。

  • TypeScript is under the Apache 2.0 license
  • Source is available via git on Codeplex
  • Installation is as easy as npm install -g typescript
  • TypeScript 在 Apache 2.0 许可下
  • 可通过 Codeplex 上的 git 获得源代码
  • 安装就像 npm install -g typescript 一样简单

回答by Newton Sheikh

TypeScript will be supported by all browsers. You can say its just another javascript. What I found TypeScript was easy to code and evern more easy to debug. Microsoft is in no mood to challenge the old JavaScript like they did by releasing Silverlight to challenge Flash.

所有浏览器都将支持 TypeScript。你可以说它只是另一个 javascript。我发现 TypeScript 易于编码并且更易于调试。微软没有心情像他们发布 Silverlight 来挑战 Flash 那样挑战旧的 JavaScript。

Anytime you feel that u want to switch back to old JavaScript and don't want to use TypeScript its even more easy to convert your ts to Js.

任何时候你觉得你想切换回旧的 JavaScript 并且不想使用 TypeScript,将你的 ts 转换为 Js 会更容易。

Try thisand see the difference between js and ts.

试试这个,看看 js 和 ts 之间的区别。