You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

CoffeeScript is a language to compiles down to JavaScript.

It can be quite controversial, but also quite effective.

On the controversial side, it uses significant whitespace to denote blocks of code (like Python or Haskell) rather than curl braces (like Java, JavaScript, or Ruby). In fact, it draws influences from a wide rage of other languages, incorporating many functional programming features, a rudimentary class system, string interpolation, destructuring assignment, and more.

However, for all that, it is very close to JavaScript; it simply rounds out many of the rough edges of JavaScript (and adds a few of its own). As wide ranging as CoffeeScript syntax can be, there's generally a very close mapping from CoffeeScript to JavaScript.

CoffeeScript code often approaches Python's goal of being a "executable psuedo-code"; code that looks like a placeholder will actually run. Some people find it more pleasant to read than JavaScript ... more essence and less ceremony.

You can still write bad code in CoffeeScript. You can write bad code in any language.

All of Tapestry's client-side code in written in CoffeeScript and compiled, at build-time, to JavaScript.

The tapestry-web-resources module adds the ability to dynamically compile CoffeeScript to JavaScript in the running application, It is recommended for anyone who wants to use CoffeeScript in their application ... just do the compilation at runtime (with access to Tapestry's full exception reporting capabilities).

  • No labels