By Alex MacCaw

This little booklet exhibits JavaScript builders the right way to construct marvelous internet functions with CoffeeScript, the impressive little language that’s gaining significant curiosity. via instance code, this consultant demonstrates how CoffeeScript abstracts JavaScript, supplying syntactical sugar and combating many universal mistakes. You’ll examine CoffeeScript’s syntax and idioms step-by-step, from uncomplicated variables and features to advanced comprehensions and classes.

Written by means of Alex MacCaw, writer of JavaScript net purposes (O’Reilly), with contributions from CoffeeScript writer Jeremy Ashkenas, this e-book speedy teaches you most sensible practices for utilizing this language—not simply at the shopper part, yet for server-side purposes besides.

It’s time to take a experience with the little language that could.

* become aware of how CoffeeScript’s syntax differs from JavaScript
* find out about positive aspects equivalent to array comprehensions, destructuring assignments, and periods
* discover CoffeeScript idioms and examine them to their JavaScript opposite numbers
* bring together CoffeeScript records in static websites with the Cake construct procedure
* Use CommonJS modules to constitution and install CoffeeScript client-side purposes
* research JavaScript’s undesirable parts—including positive aspects CoffeeScript used to be in a position to repair

Show description

Read or Download The Little Book on CoffeeScript PDF

Best programming books

Programming iOS 8: Dive Deep into Views, View Controllers, and Frameworks

Commence development apps for iOS eight with Apple's rapid programming language. If you're grounded within the fundamentals of Xcode and the Cocoa framework, this booklet presents a established rationalization of all crucial real-world iOS app parts. via deep exploration and copious code examples, you'll how one can create perspectives, manage view controllers, and use iOS frameworks for including positive aspects corresponding to audio and video, entry to person calendars and photographs, and monitoring the device's position.

Learning Unity Android Game Development

Cohesion five is a revolution in constructing nice video games for Android that gives a very good integration platform that works seamlessly with solidarity five, because of this video games could be built speedier and more uncomplicated than ever before.

Packed with loads of examples, this e-book begins by way of supporting you to appreciate all of the nice positive factors that solidarity five and Android need to supply. you'll then create nice video games like Tic-Tac-Toe and the Monkey Ball video game and likewise learn how to increase them. you are going to then extend the game's setting with lighting fixtures and a skybox and learn how to create enemies in a tank conflict video game. you are going to then discover the contact and tilt controls with the production of a Monkey Ball clone.

With the sport of a video game just like offended Birds, you are going to delve into configuring physics and innovations for a 2nd video game adventure. ultimately, you'll get a whole event by way of studying the optimization options had to maintain your video games operating easily.

Functional Programming Languages and Computer Architecture: 5th ACM Conference Cambridge, MA, USA, August 26–30, 1991 Proceedings

This publication bargains a accomplished view of the simplest and the most recent paintings in practical programming. it's the court cases of a tremendous foreign convention and comprises 30 papers chosen from 126 submitted. a few issues emerge. One is a turning out to be curiosity in varieties: strong sort structures or style checkers aiding overloading, coercion, dynamic forms, and incremental inference; linear varieties to optimize garage, and polymorphic kinds to optimize semantic research.

Additional resources for The Little Book on CoffeeScript

Example text

The upside of this approach is that CoffeeScript is inherently compatible with every JavaScript runtime. js, in Rhino, in Photoshop and Illustrator—in short, everywhere JavaScript can run. If you want to use CoffeeScript for a project, for a component, or even just for a single file, you don’t have to sacrifice performance or compatibility with other JavaScript libraries. 44 | Chapter 6: The Little Conclusion Build Your Own JavaScript There’s a hidden motive running as a subtext beneath CoffeeScript.

Strict Mode Usage All you need to do to enable strict checking is start your script or function with the following string: -> "use strict" # ... your code ... That’s it, just the "use strict" string. Couldn’t be simpler and it’s completely backwards compatible. Let’s take a look at strict mode in action. callee, as they’re major performance hogs, and is now throwing syntax errors whenever they’re used. There’s a particular gotcha you should look out for when using strict mode, namely creating global variables with this.

I can’t stress enough how important application architecture is; if you’re writing any JavaScript/CoffeeScript beyond simple form validation, you should implement a form of application structure, such as MVC. The secret to building maintainable large applications is not to build large applications. In other words, build a series of modular de-coupled components. Keep application logic as generic as possible, abstracting it out as appropriate. Lastly, separate out your logic into views, models, and controllers (MVC).

Download PDF sample

Rated 5.00 of 5 – based on 37 votes