Screen2.0

 
 
 

hints & tips, links // 2011.01.07 08:34:18 [hh]

"Expose the good parts": "JavaScript" stark vereinfacht in "CoffeeScript"

Weg mit den Klammern und geschachtelten Kontrollstrukturen: "CoffeeScript" ist eine kleine Sprache, welche mathematische und funktionale Konstrukte in "JavaScript" übersetzt. Einige kompliziert aussehende Konstrukte können hier sehr elegant und kompakt formuliert werden, wie die zahlreichen Beispiele zeigen. "CoffeeScript" wäre eigentlich der ideale Preprocessor für "JavaScript"-Code.

"CoffeeScript is a little language that compiles into JavaScript. Underneath all of those embarrassing 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 (and vice-versa). The compiled output is readable and pretty-printed, passes through JavaScript Lint without warnings, will work in every JavaScript implementation, and tends to run as fast or faster than the equivalent handwritten JavaScript."

Direkter Link: jashkenas.github.com/ coffee-script

 

Werbung