Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


Use CoffeeScript to Write Better JavaScript Code Than Ever Before!

If you can do it in JavaScript, you can do it better in CoffeeScript. And, since CoffeeScript “compiles down” to JavaScript, your code will fit neatly into virtually any web environment. In Programming in CoffeeScript, Mark Bates shows web developers why CoffeeScript is so useful and how it avoids the problems that often make JavaScript code buggy and unmanageable. He guides you through every feature and technique you need to write quality CoffeeScript code and shows how to take advantage of CoffeeScript’s increasingly robust toolset.

Bates begins with the absolute basics of running and compiling CoffeeScript and then introduces syntax, control structures, functions, collections, and classes. Through same page code comparisons, you’ll discover exactly how CoffeeScript improves on JavaScript. Next, you’ll put it to work in building applications that are powerful, flexible, maintainable, concise, reliable, and secure. Bates shares valuable tips for better development, illuminating CoffeeScript’s hidden gems and warning you about its remaining “rough edges.” The book concludes with a start-to-finish application case study showing how to code back-ends and front-ends and integrate powerful frameworks and libraries. Coverage includes

  • Understanding the right ways to compile and execute CoffeeScript

  • Using CoffeeScript’s clean syntax to focus on your code, not JavaScript’s distractions

  • Working with CoffeeScript’s control structures, functions, and arguments

  • Taking full advantage of CoffeeScript’s implementation of collections and iterators

  • Leveraging CoffeeScript’s full class support to create complex data models

  • Automating common application development tasks with Cake and Cakefiles

  • Configuring Jasmine with CoffeeScript support, and using it to systematically test your code

  • Writing Node.js server-side applications in CoffeeScript

  • Using CoffeeScript to write jQuery and Backbone.js applications

  • Integrating framework code to avoid “reinventing the wheel”

Want a better way to create the JavaScript code your web applications need? CoffeeScript is the solution–and this book will help you master it!


Subscriber Reviews

Average Rating: 3.8 out of 5 rating Based on 5 Ratings

"programming in coffeescript" - by bryanmann on 29-MAY-2013
Reviewer Rating: 1 star rating2 star rating3 star rating4 star rating5 star rating
Might be the worst programming book EVER!

Take operators and aliases for example.  The arithmetic operators for javascript are presented and then a confusing list of console.logs of coffeescript are presented.  First I'm here to learn coffeescript, don't care about reviewing javascript and second if i wanted to execute coffeescript I'd type it in and execute it.

If the author would like to contact me to discuss fixing this issues I'd be happy to review and recommend changes.


Report as Inappropriate

"Great CoffeeScript Overview" - by Brian L on 19-JUL-2012
Reviewer Rating: 1 star rating2 star rating3 star rating4 star rating5 star rating
I love how it presents CoffeeScript, especially in the context of Node.js, jQuery, and Backbone.js. I knew I was going to be using jQuery but ended up learning a bit about the other two as well. This book is well framed to modern technology.
Report as Inappropriate

"brief, but to the point" - by julz on 25-JUN-2012
Reviewer Rating: 1 star rating2 star rating3 star rating4 star rating5 star rating
Good intro
Report as Inappropriate

Table of Contents



The publisher has provided additional content related to this title.


These links have been provided by the publisher.

  • Companion Web site