Like This Site? 
 
RSS Feed Follow Us 

on Twitter! Be Our Fan!

Should You Learn CoffeeScript?

Share this post!
 Vote this!


Perhaps the most common question: if I’m a reasonably solid JavaScript developer, is there any real incentive for me to learn CoffeeScript? 

Yes. CoffeeScript is not an entirely new and strange language. It exists to allow “reasonably solid” JavaScript developers to write the same code they were going to write in the first place, in a more readable and fluent way. The basic idea is to write what you mean, instead of writing within the limits of historical accident. For example, if I want to loop over every item in a list, in CoffeeScript, I can write what I mean:


1
2
  for item in list
  process item

Whereas in JavaScript, I partially obscure my intention, by writing:

1    
2
3
4
for (var i = 0, l = list.length; i < l; i++) {
var item = list[i];
process(item);
}
CoffeeScript allows “reasonably solid” JavaScript developers to accomplish the latter by simply writing the former.

More...

0 comments:

Post a Comment