4 ms·
Ten Features I Like About CoffeeScript
- mistercow 14y agoThe 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").
- ef4 14y agoMy 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.
- gmac 14y agoThere's also the andand gem, but again it's a lot less clean and expressive than a simple ?.