CoffeeScript: Accelerated JavaScript Development

Overview

CoffeeScript is JavaScript done right. It provides all of JavaScript's functionality wrapped in a cleaner, more succinct syntax. In the first book on this exciting new language, CoffeeScript guru Trevor Burnham shows you how to hold onto all the power and flexibility of JavaScript while writing clearer, cleaner, and safer code.

CoffeeScript: Accelerated JavaScript Development offers a thorough introduction to this new language, starting from the basics. You'll learn to use ...

See more details below
Paperback
$25.18
BN.com price
(Save 13%)$29.00 List Price

Pick Up In Store

Reserve and pick up in 60 minutes at your local store

Other sellers (Paperback)
  • All (16) from $1.99   
  • New (9) from $15.54   
  • Used (7) from $1.99   
Sending request ...

Overview

CoffeeScript is JavaScript done right. It provides all of JavaScript's functionality wrapped in a cleaner, more succinct syntax. In the first book on this exciting new language, CoffeeScript guru Trevor Burnham shows you how to hold onto all the power and flexibility of JavaScript while writing clearer, cleaner, and safer code.

CoffeeScript: Accelerated JavaScript Development offers a thorough introduction to this new language, starting from the basics. You'll learn to use time-saving features like list comprehensions and splats, organize your code into modules with extensible classes, and deploy your work to multiple environments.

Each chapter is example-driven and includes challenging exercises to push your CoffeeScript know-how further. Through the course of the book, you'll build a fast-paced multiplayer word game-writing both the client (with jQuery) and server (with Node.js) in CoffeeScript. And because the two languages are so deeply intertwined, you'll deepen your understanding of JavaScript along the way.

CoffeeScript makes it easier than ever to write powerful, standards-compliant JavaScript code. CoffeeScript: Accelerated JavaScript Development lets you start doing it today.

Read More Show Less

Product Details

  • ISBN-13: 9781934356784
  • Publisher: Pragmatic Programmers, LLC, The
  • Publication date: 8/3/2011
  • Pages: 138
  • Sales rank: 1,397,993
  • Product dimensions: 7.50 (w) x 8.90 (h) x 0.60 (d)

Meet the Author

Trevor Burnham is a full-stack web developer with a passion for new technologies. He is the founder of DataBraid, a startup developing scientific computing tools that support remote collaboration. When on Twitter, he goes by @TrevorBurnham and @CoffeeScript. When offline, he's usually in Cambridge, MA.

Read More Show Less

Table of Contents

Foreword xi

Acknowledgments xiii

Preface xv

1 Getting Started 1

1.1 Installing CoffeeScript 1

1.2 Text Editors for CoffeeScript 5

1.3 Meet'coffee' 6

1.4 Debugging CoffeeScript 9

2 Functions, Scope, and Context 13

2.1 Functions 101 13

2.2 Scope: Where You See 'Em 18

2.3 Context (or, "What Is 'this'?") 21

2.4 Property Arguments (@arg) 24

2.5 Default Arguments (arg =) 25

2.6 Splats (…) 28

2.7 Project: 5x5 Input Parser 29

2.9 Exercises 34

3 Collections and Iteration 37

3.1 Objects as Hashes 37

3.2 Arrays 40

3.3 Iterating over Collections 43

3.4 Conditional Iteration 46

3.5 Comprehensions 47

3.6 Pattern Matching (or, Destructuring Assignment) 48

3.7 Project: 5x5 Solitaire 50

3.9 Exercises 56

4 Modules and Classes 59

4.1 Modules: Splitting Up Apps 60

4.2 The Power of Prototypes 61

4.3 Classes: Functions with Prototypes 63

4.4 Inheritance with 'extends' 65

4.5 Project: Refactoring 5x5 68

4.7 Exercises 72

5 Web Interactivity with jQuery 75

5.1 The Tao of jQuery 76

5.2 Manipulating the DOM 76

5.3 Getting Selective 77

5.4 Reacting to Events 79

5.5 Project: Browser-Based 5x5 80

5.7 Exercises 87

6 Server-Side Apps with Node.js 89

6.1 What Is Node.js? 89

6.2 Modularizing Code with 'exports' and 'require' 90

6.3 Thinking Asynchronously 91

6.4 Project: Multiplayer 5x5 95

6.6 Exercises 103

A1 Answers to Exercises 105

A1.1 Functions, Scope, and Context 105

A1.2 Collections and Iteration 107

A1.3 Modules and Classes 109

A1.4 Web Interactivity with jQuery 110

A1.5 Server-Side Apps with Node.js 111

A2 Ways of Running CoffeeScript 113

A2.1 Web Consoles 113

A2.2 Running CoffeeScript in Your Web App 114

A2.3 CoffeeScript on Rails 114

A2.4 CoffeeScript via Middleware 115

A2.5 CoffeeScript on Node.js 115

A2.6 Rapid Websites with Middleman 116

A2.7 CoffeeScript for System Scripts 117

A3 Cheat Sheet for JavaScripters 119

A3.1 Boolean Operators 119

A3.2 The Existential Operator 119

A3.3 Context and Prototype Accessors 120

A3.4 Function Definitions 120

A3.5 Conditionals 120

A3.6 Property Existence 120

A3.7 Iteration 121

A4 Bibliography 123

Index 125

Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star

(0)

4 Star

(0)

3 Star

(0)

2 Star

(0)

1 Star

(0)

Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation

Reminder:

  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

 
Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously

    If you find inappropriate content, please report it to Barnes & Noble
    Why is this product inappropriate?
    Comments (optional)