Foreword

JavaScript was born free, but until recently it was in chains everywhere.

JavaScript wasn’t always a very pleasant language to work in: it’s terribly slow, it’s implemented with different quirks in different browsers, and it’s been stuck fast in the amber of time since the late 1990s. Perhaps you used it in the past to implement a drop-down menu or a reorderable list, but you probably didn’t enjoy the experience.

Fortunately for us, the JavaScript of today is enjoying a well-deserved renaissance. Thanks to the tireless efforts of browser implementers, JavaScript is now the fastest mainstream dynamic language. It’s present everywhere, from servers to Photoshop, and it’s the only language you can use to program all angles of the Web.

CoffeeScript is a little language that aims to give you easy access to the good parts of JavaScript: the first-class functions, the hash-like objects, even the much-misunderstood prototype chain. If we do our job right, you’ll end up writing one-third less code to generate much the same JavaScript you would’ve written in the first place.

CoffeeScript places a high value on the readability of code and the elimination of syntactic clutter. At the same time, there’s a fairly one-to-one correspondence between CoffeeScript and JavaScript, which means that there should be no performance penalty—in fact, many JavaScript libraries end up running faster after being ported to CoffeeScript, due to some of the optimizations the compiler can perform.

You’re fortunate to have picked up this book, because Trevor has been an enthusiastic contributor to CoffeeScript since the early days. Few people know more about the ins and outs of the language or the history of the debate behind language features and omissions than he does. This book is a gentle introduction to CoffeeScript led by an expert guide.

I’m looking forward to hearing about all of the exciting projects that I’m sure will come out of it, and—who knows—perhaps you’ll be inspired to create a little language of your very own.

Jeremy Ashkenas, creator of CoffeeScript
April 2011
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.114.28