Chapter 1. The road to CoffeeScript

 

This chapter covers

  • Why CoffeeScript matters
  • How to get started
  • The evolution of JavaScript
  • Adapting to evolution by using CoffeeScript

CoffeeScript is a small, general-purpose programming language. It was created by Jeremy Ashkenas and first released in 2009. It’s a compiled language: you write your program in CoffeeScript and then use the compiler to translate it to an equivalent JavaScript program. When you run your program, it’s the compiled JavaScript that runs. Think of your CoffeeScript programs as being JavaScript programs underneath.

There are many programming languages that can compile to JavaScript, so many that they might even outnumber the programming languages that don’t compile to JavaScript. CoffeeScript is rare among these languages because it keeps the core structure and semantics of JavaScript intact. CoffeeScript is essentially JavaScript. If it’s essentially JavaScript though, why bother to use CoffeeScript? What’s the benefit?

1.1. Why CoffeeScript?

CoffeeScript is a simple language, and there are two simple reasons for learning it. First, it fixes some problems in JavaScript that are unpleasant to work with. Second, understanding CoffeeScript will help you learn new ways of using JavaScript, and new ways of programming in general.

1.2. Running CoffeeScript

 
 
 
 

1.3. JavaScript

 
 

1.4. Evolving JavaScript

 
 

1.5. Creating CoffeeScript

 
 
 

1.6. Summary

 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest