有没有人使用Coffeescript作为生产应用程序? [英] Has anyone used Coffeescript for a production application?

查看:111
本文介绍了有没有人使用Coffeescript作为生产应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Coffeescript 看起来很酷。有没有人使用它?它的优点&缺点?

解决方案

我们已经开始在我们的产品中使用CoffeeScript,这是一个非公开的网站,浏览某些种类的数据。
我们使用CoffeeScript作为命令行编译器(不是在服务器上,我们最终想要这样做。)



PROS (for us):




  • 它消除了javascript中大量的不必要的混乱(例如大括号,分号, )到代码比javascript更简洁易于理解的程度
  • 比javascript少20-30%的代码行(做同样的事情)

  • CoffeeScript不仅消除噪点,而且增加了关键字,类和像heredoc的功能,使编码更清晰,更有趣。

  • 鉴于以上几点,

  • b b b b b b b

    • 当使用命令行编译器时:调试时,在解决问题(javascript)时,正在编写修正(coffeescript)时,会看到不同的代码。然而,有点令人难以置信,我们的CoffeeScript是如此真棒,我们从来没有需要调试它!



    重要的是,我们可以随时回来。我们的coffeescript编译器只是产生可读的JavaScript,所以如果任何人改变主意或不能计算出一些东西,那么我们可以回到使用生成的coffeescript的JavaScript并保持编码。


    Coffeescript looks pretty cool. Has anyone used it? What are its Pros & Cons?

    解决方案

    We've started to use CoffeeScript in our product - a non-public facing website which is basically an app for browsing certain kinds of data. We use CoffeeScript as a command-line compiler (not on the server, which we'd eventually like to do).

    PROS (for us):

    • It gets rid of a lot of needless clutter in javascript (eg braces, semi-colons, some brackets) to the extent that the code is cleaner & easier to comprehend at-a-glance than javascript
    • 20-30% less lines of code than javascript (to do exactly the same thing)
    • CoffeeScript not only removes noise but adds keywords, classes, and features like heredocs to make coding cleaner and somewhat more enjoyable
    • Given the previous points, it is undoubtedly faster to code in CoffeeScript once you learn the ropes

    CONS

    • When using the command-line compiler: to debug, you're looking at different code when solving the problem (javascript) as when writing the fix (coffeescript). However, somewhat unbelievably, our CoffeeScript is so awesome we've never needed to debug it!

    Importantly, we can turn back at anytime. Our coffeescript compiler is just producing readable javascript, so if anyone changes their mind or can't figure something out, then we can just drop back to using the javascript that coffeescript produced - and keep coding.

    这篇关于有没有人使用Coffeescript作为生产应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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