Hacker News new | comments | show | ask | jobs | submit login
Ten Features I Like About CoffeeScript (openmymind.net)
11 points by jashkenas 1954 days ago | hide | past | web | 3 comments | favorite

The amazing thing about CoffeeScript is that most of what it does is tiny little changes that shouldn't matter that much, yet the overall effect is huge. For example, string interpolation involves one fewer character than concatenation, yet the effect on readability would be hard to overstate.

A similar feature in another language is PHP's ability to mix in with HTML. It would be utterly trivial to convert the HTML sections of a PHP file to echo statements. Yet this tiny bit of sugar goes a huge distance toward making up for the language's short comings (also known as "almost everything else about PHP").

My single favorite thing about CoffeeScript seems tiny, but makes a huge difference: the chainable existential operator.

It's gotten to the point where I keep trying to use it in Ruby and getting annoyed that it's not there. Rails at least adds Object#try, but it's not nearly as nice.

There's also the andand gem, but again it's a lot less clean and expressive than a simple ?.

Applications are open for YC Winter 2018

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact