内容简介:
At the heart of JavaScript is a beautiful little language.
Unfortunately, that inner beauty is clouded with awkward syntax and structure. CoffeeScript is a new way to write JavaScript, providing Ruby-like readability and a more expressive syntax. It compiles into standard JavaScript and works on all implementations without modification.
CoffeeScript in Action is a tutorial that teaches you how, where, and why to use CoffeeScript. It begins by quickly exposing you to CoffeeScript's new, but instantly-familiar syntax. Then, you'll explore programming challenges that illustrate CoffeeScript's unique advantages. Language junkies will especially appreciate how this book takes idioms from other programming languages and shows you how CoffeeScript makes them available in JavaScript.
So why you should bother learning a new way to code JavaScript?
CoffeeScript preserves everything you know and love about JavaScript and wraps it in a modern, efficient syntax. It's perfect for complex web programming, including server-side JavaScript executing on Node.js. CoffeeScript also enhances JavaScript's natural Functional Programming features, a big advantage for building high-capacity, fault-tolerant applications. CoffeeScript is fully supported in Rails 3.1, and, via a free plugin, even Microsoft Visual Studio. Plus, it's really cool.
WHAT'S INSIDE
Complete coverage of CoffeeScript's syntax and structure
Examples illustrating best practices and patterns for web application development
Introduction to functional programming
Prototype-based OOP
This book is written for developers with exposure to JavaScript. No prior exposure to CoffeeScript is required.
作者简介:
Patrick Lee is a developer, designer, and consultant with ThoughtWorks.
目录:
Table of Contents Resources
PART 1 FOUNDATIONS
1 The road to CoffeeScript - FREE
2 Syntax - AVAILABLE
3 Functions - AVAILABLE
4 Dynamic objects - AVAILABLE
PART 2 COMPOSITION
5 Composing objects - AVAILABLE
6 Composing with functions
7 Advanced syntax and other idioms
8 Metaprogramming
9 Thinking asynchronous
PART 3 WRITING PROGRAMS
10 Server techniques
11 Driving with tests - AVAILABLE
12 Client and interface techniques
13 Modules and builds - AVAILABLE
14 The future
APPENDIXES
A Reserved words - AVAILABLE
B Answers to exercises - AVAILABLE
Author Online
Go here to discuss this title with the author
CoffeeScript vs. JavaScript (PDF)
Source code (331 KB)
Welcome to CoffeeScript (PDF)