Back to Browse

Programming in CoffeeScript: Learn to Write Better JavaScript Code

1.3K views
Nov 8, 2012
5:06

Programming in CoffeeScript: http://www.informit.com/store/programming-in-coffeescript-9780321820105 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. InProgramming 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 Dedication v Acknowledgments xii About the Author xiv Preface xv What Is CoffeeScript? xvii Who Is This Book For? xix How to Read This Book xix How This Book Is Organized xxi Part I: Core CoffeeScript xxii Part II: CoffeeScript in Practice xxii Installing CoffeeScript xxiii How to Run the Examples xxiii Notes xxiv Part I: Core CoffeeScript 1 Getting Started 3 The CoffeeScript REPL 3 In-Browser Compilation 6 Caveats 7 Command-Line Compilation 7 The compile Flag 7 The CoffeeScript CLI 8 The output Flag 9 The bare Flag 9 The print Flag 10 The watch Flag 10 Executing CoffeeScript Files 11 Other Options 11 Wrapping Up 12 Notes 12 2 The Basics 13 Syntax 13 Significant Whitespace 14 Function Keyword 16 Parentheses 16 Scope and Variables 18 Variable Scope in JavaScript 18 Variable Scope in CoffeeScript 19 The Anonymous Wrapper Function 20 Interpolation 23 String Interpolation 23 Interpolated Strings 23 Literal Strings 25 Heredocs 28 Comments 29 Inline Comments 29 Block Comments 30 Extended Regular Expressions 31 Wrapping Up 31 Notes 32 View the complete TOC here: http://www.informit.com/store/programming-in-coffeescript-9780321820105

Download

0 formats

No download links available.

Programming in CoffeeScript: Learn to Write Better JavaScript Code | NatokHD