O'Reilly logo

Smashing CoffeeScript by Alex Hudson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Introduction

If you have bought this book, or at least picked it up because it interested you, then you have at least heard of CoffeeScript and have an inkling of what the language is. In the words of its author, “CoffeeScript is a little language that compiles into JavaScript,” and in a sense, that is all you need to know about the language. But a number of more profound ideas follow from that simple concept.

To understand CoffeeScript properly, it’s important to understand the history of JavaScript. In the early days of Netscape Navigator, an engineer by the name of Brendan Eich was given the task of writing a scripting language that the browser would interpret, along with only two guiding principles. First, the language needed to look like Java, because that was the cool language at the time. Second, he had only ten days to write a functioning implementation.

That was a tremendously tall order but one that Eich was equal to. He created a small, language that fulfilled looked and acted like Java, called “Mocha”. Additionally, he made decisions that set the language apart from others, such as treating functions as first-class objects that could be passed around at will and using prototypical object inheritance rather than the classical style preferred by the likes of C++ and Java. JavaScript, as it was eventually called, saw its first release in 1995 as part of Netscape Navigator 2.0.

In early 2000, Microsoft released a new version of its web e-mail/calendaring client, Outlook ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required