http://jashkenas.github.com/coffee-script/CoffeeScript documentation wrote: CoffeeScript is a little language that compiles into JavaScript. Underneath all those awkward braces and semicolons, JavaScript has always had a gorgeous object model at its heart. CoffeeScript is an attempt to expose the good parts of JavaScript in a simple way.
The golden rule of CoffeeScript is: "It's just JavaScript". The code compiles one-to-one into the equivalent JS, and there is no interpretation at runtime. You can use any existing JavaScript library seamlessly from CoffeeScript (and vice-versa). The compiled output is readable and pretty-printed, passes through JavaScript Lint without warnings, will work in every JavaScript runtime, and tends to run as fast or faster than the equivalent handwritten JavaScript.
And some words from me:
+
it has good syntax. (to do same thing you need less code)
code is more readable.
code is more valid (you will never forget about var. You cant shoot you legs by using global variable in cycles)
-
You need to learn it. (I have experience in languages which influenced it syntax, I just read docks and start writing.)
Debugging is not good.
Here just two files in js and coffeescript for example:
coffescript
javascript
At current time there is no good way to load coffeescript directy in the game. But it is easy to add. To convert coffescript to javascript you just need js file.
Code: Select all
include('multiplay/skirmish/coffee-script.js')
CoffeeScript.eval('console "It works!"')