Smooth CoffeeScript: Discover the Beauty of Functional Programming in CoffeeScript
Try CoffeeScript in your HTML 5 web browser. Edit examples, run programs, solve exercises without installation or plug-ins. Compatible with up-to-date desktop browsers and Mobile Safari even offline.
Smooth CoffeeScript is a book about CoffeeScript and programming. Start with programming fundamentals, learn about functional programming with Underscore and problem solving, study object orientation and modularity. It covers client/server web apps with Canvas and WebSockets.
No previous programming knowledge is required. CoffeeScript lets you write web oriented applications simply and elegantly. It is closely related to JavaScript but without its quirky corners. Together with the JavaScript Basics supplement you can learn both at once.
CoffeeScript is a lucid evolution of JavaScript created by Jeremy Ashkenas. This book attempts to be an evolution of ‘Eloquent JavaScript’ by Marijn Haverbeke. Apart from the major change in explaining CoffeeScript instead of JavaScript, numerous other changes have been made and sections have been added, edited or removed.
The program examples in this book live in an interactive environment where you can change the examples and create new solutions while you learn CoffeeScript. The environment also includes the Underscore functional library, the Coffeekup HTML markup, and qc, a QuickCheck based testing library. These libraries extend CoffeeScript with useful abstractions and testing tools to keep focus on the task at hand instead of distracting boilerplate code.
While it is possible to express programs from a very small set of language primitives, it quickly becomes tedious and error prone to do so. The approach taken here is to include a broader set of functional building blocks as if they were a native part of the programming language. By thinking in terms of these higher level constructs more complex problems can be handled with less effort.
To ensure correctness testing is required. This is especially true when developing reusable algorithms in a dynamic and untyped language. By integrating QuickCheck style test cases as soon as functions are introduced, it is intended that writing tests and declaring assumptions become a seamless part of writing software.