<commit_before>{
  "title": "CoffeeScript",
  "description": "It's just JavaScript, but sweeter",
  "template": "article.jade",
  "date": "2012-03-21"
}

This site is generated by [Blake](http://michaelnisi.github.com/blake/), a little Node module I wrote. When I sat down to implement the views for it, I realized that this finally offered a good opportunity to try [CoffeeScript](http://coffeescript.org). I pretty much enjoy to write JavaScript, especially within Node it's a feast, but the elegance of CoffeeScript's syntax is too intrigueing for me to resist. So, what are the questions I try to anser here? What are the more relevant features of CoffeeScript? What are its advantages? In which use cases would I use it? Does it have an influence on the future development of JavaScript? 

As CoffeeScript transcompiles to [JavaScript](https://developer.mozilla.org/en/JavaScript), I briefly reintroduce JavaScript first. JavaScript is a lightweight, object-oriented language, most known as the scripting language for web pages, but used in many non-browser environments as well. JavaScript was created in 1995 by <NAME> at Netscape. His objective was to make it look like Java, but he subversivly made it look like C. The name was a marketing stunt to free ride the [Java](http://en.wikipedia.org/wiki/Java_(programming_language)) hype of the time. The language however has nothing in common with Java, its idiotic name has been contributing to JavaScript's misinterpretation until today. JavaScript is the Cinderella of programming languages. Abused and underrated.

Popular JavaScript engines are Google's [V8](http://code.google.com/p/v8/), which is used in [Chrome](https://www.google.com/chrome) and [Node.js](http://nodejs.org/); [JavaScriptCore](http://www.webkit.org/projects/javascript/) (SquirrelFish/Nitro), used in some [WebKit](http://www.webkit.org/) browsers such as Apple Safari; and Mozilla's [SpiderMonkey](https://developer.mozilla.org/en/SpiderMonkey).

CoffeeScript is the little mystery programming language, written by [<NAME>](https://github.com/jashkenas). The language is inspired by Ruby, Python and Haskell; it adds features like array comprehension and pattern matching.

No global variables, CommonJS modules

I was always hesitant in regards of meaningful whitespace, but when I came to think about it again I realized that it solves the problem of sane formatting. With meaningful whitespace you no longer have to argue about why expressing once individuality in code formatting isn't cool. Less discussions about things that are not relevant to user experience are good.

Less lines, less code

The last expression in a function is returned

splats and default arguments

comprehensions

strings

fat arrow function

myFunction(item) for item in items

Destructuring assignments

	{a, b} = { a:'a', b:'b' }
	console.log "a is '#{a}', b is '#{b}'"
<commit_msg>Test post-receive hook<commit_after>{
  "title": "CoffeeScript",
  "description": "It's just JavaScript, but sweeter",
  "template": "article.jade",
  "date": "2012-03-21"
}

This site is generated by [Blake](http://michaelnisi.github.com/blake/), a little Node module I wrote. When I sat down to implement the views for it, I realized that this finally offered a good opportunity to try [CoffeeScript](http://coffeescript.org). I pretty much enjoy to write JavaScript, especially within Node it's a feast, but the elegance of CoffeeScript's syntax is too intrigueing for me to resist. So, what are the questions I try to anser here? What are the more relevant features of CoffeeScript? What are its advantages? In which use cases would I use it? Does it have an influence on the future development of JavaScript? 

As CoffeeScript transcompiles to [JavaScript](https://developer.mozilla.org/en/JavaScript), I briefly reintroduce JavaScript first. JavaScript is a lightweight, object-oriented language, most known as the scripting language for web pages, but used in many non-browser environments as well. JavaScript was created in 1995 by <NAME> at Netscape. His objective was to make it look like Java, but he subversivly made it look like C. The name was a marketing stunt to free ride the [Java](http://en.wikipedia.org/wiki/Java_(programming_language)) hype of the time. The language however has nothing in common with Java, its idiotic name has been contributing to JavaScript's misinterpretation until today. JavaScript is the Cinderella of programming languages. Abused and underrated.

Popular JavaScript engines are Google's [V8](http://code.google.com/p/v8/), which is used in [Chrome](https://www.google.com/chrome) and [Node.js](http://nodejs.org/); [JavaScriptCore](http://www.webkit.org/projects/javascript/) (SquirrelFish/Nitro), used in some [WebKit](http://www.webkit.org/) browsers such as Apple Safari; and Mozilla's [SpiderMonkey](https://developer.mozilla.org/en/SpiderMonkey).

CoffeeScript is the little mystery programming language, written by [<NAME>](https://github.com/jashkenas). The language is inspired by Ruby, Python and Haskell; it adds features like array comprehension and pattern matching.

I never been fond of transcompilation, but CoffeeScript's elegance seduced me to try it. With my first sips of CoffeeScript my skepticism transformed into enthusiasm, writing plain JavaScript just doesn't cut it anymore. It has this stale taste of something that was great in the past, but when revisited, isn't that great anymore. Don't get me wrong, I appreciate JavaScript. ActionScript, an ECMAScript derivate, had been my bread and butter language for the longest time, so my relationship with JavaScript is rather intimate, which is probably one of the reasons why I'm embracing CoffeeScript. So, what are the main advantages?
No global variables, CommonJS modules

I was always hesitant in regards of meaningful whitespace, but when I came to think about it again I realized that it solves the problem of sane formatting. With meaningful whitespace you no longer have to argue about why expressing once individuality in code formatting isn't cool. Less discussions about things that are not relevant to user experience are good.

Less lines, less code

The last expression in a function is returned

splats and default arguments

comprehensions

strings

fat arrow function

myFunction(item) for item in items

Destructuring assignments

	{a, b} = { a:'a', b:'b' }
	console.log "a is '#{a}', b is '#{b}'"

{'fraction_non_alphanumeric': 0.0770425598011805, 'fraction_numerical': 0.004349176762969867, 'mean_word_length': 4.9019248395967, 'pattern_counts': {'":': 8, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 8, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '339485', 'n_tokens_mistral': 1733, 'n_tokens_neox': 1615, 'n_words': 856}