Programming in CoffeeScript
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!
Table of Contents
Part I: Core CoffeeScript
Chapter 1. Getting Started
Chapter 2. The Basics
Chapter 3. Control Structures
Chapter 4. Functions and Arguments
Chapter 5. Collections and Iterations
Chapter 6. Classes
Part II: CoffeeScript in Practice
Chapter 7. Cake and Cakefiles
Chapter 8. Testing with Jasmine
Chapter 9. Intro to Node.js
Chapter 10. Example: Todo List Part 1 (Server-side)
Chapter 11. Example: Todo List Part 2 (Client-side w/ jQuery)
Chapter 12. Example: Todo List Part 3 (Client-side w/ Backbone.js)
Book Details
- Paperback: 320 pages
- Publisher: Addison-Wesley Professional (May 2012)
- Language: English
- ISBN-10: 032182010X
- ISBN-13: 978-0321820105
Instead of using Jasmine for the tests, you might find CasperJS a lot much better (integration with node.js can be done via SpookyJS).