Read more
This concise book shows JavaScript developers how to build superb web applications with CoffeeScript, the remarkable language that's gaining considerable interest. Through example code, this guide demonstrates how CoffeeScript abstracts JavaScript, providing syntactical sugar and preventing many common errors. You'll learn CoffeeScript's syntax and idioms step by step, from basic variables and functions to complex comprehensions and classes.
Written by Alex MacCaw, author of JavaScript Web Applications (O'Reilly), with contributions from CoffeeScript creator Jeremy Ashkenas, this book quickly teaches you best practices for using this language - not just on the client side, but for server-side applications as well. It's time to take a ride with the little language that could. Discover how CoffeeScript's syntax differs from JavaScript Learn about features such as array comprehensions, destructuring assignments, and classes Explore CoffeeScript idioms and compare them to their JavaScript counterparts Compile CoffeeScript files in static sites with the Cake build system Use CommonJS modules to structure and deploy CoffeeScript client-side applications Examine JavaScript's bad parts - including features CoffeeScript was able to fix
List of contents
Preface;
What Is CoffeeScript?;
Initial Setup;
Conventions Used in This Book;
Using Code Examples;
Safari® Books Online;
How to Contact Us;
Chapter 1: CoffeeScript Syntax;
1.1 Variables and Scope;
1.2 Functions;
1.3 Object Literals and Array Definition;
1.4 Flow Control;
1.5 String Interpolation;
1.6 Loops and Comprehensions;
1.7 Arrays;
1.8 Aliases and the Existential Operator;
Chapter 2: CoffeeScript Classes;
2.1 Instance Properties;
2.2 Static Properties;
2.3 Inheritance and Super;
2.4 Mixins;
2.5 Extending Classes;
Chapter 3: CoffeeScript Idioms;
3.1 Each;
3.2 Map;
3.3 Select;
3.4 Includes;
3.5 Property Iteration;
3.6 Min/Max;
3.7 Multiple Arguments;
3.8 And/Or;
3.9 Destructuring Assignments;
3.10 External Libraries;
3.11 Private Variables;
Chapter 4: Compiling CoffeeScript;
4.1 Cake;
4.2 Creating Applications;
Chapter 5: The Good Parts;
5.1 The Unfixed parts;
5.2 The Fixed Parts;
5.3 JavaScript Lint;
Chapter 6: The Little Conclusion;
6.1 Philosophy;
6.2 It's Just JavaScript;
6.3 Build Your Own JavaScript;
About the author
Alex MacCaw ist Unternehmer und Ruby- und JavaScript-Entwickler. Er hat das JavaScript-Framework Spine geschrieben, einige größere Anwendungen - unter anderem Taskforce und Socialmod - entworfen und eine Menge Open Source-Arbeit geleistet. Er hat auf Ruby/Rails-Konferenzen in New York, San Francisco und Berlin vorgetragen. Zurzeit bereist er gerade die Welt mit einer Nikon D90 und einem Surfbrett.
Summary
This little book shows JavaScript developers how to build superb web applications with CoffeeScript, the remarkable little language that's gaining considerable interest. Through example code, this guide demonstrates how CoffeeScript abstracts JavaScript, providing syntactical sugar and preventing many common errors.