CoffeeScript

What is it?

  • CoffeeScript is a little language that compiles into JavaScript.
  • The golden rule of CoffeeScript is: “It’s just JavaScript”.

More info in README

When I saw CoffeeScript first time it looks weird: ‘:’ instead of ‘=’ and other strange things. And I wasn’t good about that. But things change and opinions of people too. Now I have very positive opinion about CS not only because CS makes code less noisy, more structured, more readable and less buggy, mostly because ECMAScript and CoffeeScript evolve together. And it makes CoffeeScript not “Yet another language that compiles to JavaScript”. CS has big influence on future and present of ECMAScript, I think. Below I have some examples(it’s not actually examples, just some links to CS website) of features that will be provided in ES6(in future version of ECMAScript specification) and these features already implemented in CS, some of them was borrowed from CS. I think, it’s awesome because we can just use nice features NOW. Also CoffeeScript provides big portion of syntax sugar(short functions, optional return, ranges, additional operators, string interpolation and etc) and fixes some bad parts of JavaScript:

Fixes

  • Problems with global scope (each file wraps to anonymous function)
  • Problems with weak typization (CS internally always uses === operator)
  • Awkward semicolons (CS has indentation syntax)

Features

Some features that will be in ES6/ES.next/ES Harmony and that already exist in CoffeeScript:

Links

Peace!

Comments