5 Things I Like About CoffeeScript
CoffeeScript
CoffeeScript is self-described as “a little language that compiles into JavaScript”. CoffeeScript implements a subset of the full JavaScript language and adds a little bit of common boilerplate code to take out some of the less savory parts of JavaScript. CoffeeScript works both in Node.js on the backend, as well as in the browser.
I gave a short survey talk at the August 15, 2012 Node.DC meetup, “5 Things I Like About CoffeeScript”.
![CoffeeScript Talk][img_talk] [img_talk]: http://loose-bits.com/media/img/2012/08/16/nodedc-coffeescript.png
The talk’s source is available on GitHub, and uses the awesome deck.js presentation framework with the CodeMirror plugin to enable editable and runnable code samples. I further hacked up the CodeMirror plugin to additionally make the CoffeeScript code examples executable (CodeMirror only does JavaScript by default).
Five Cool Things in CoffeeScript
For the impatient, the five topics I covered are:
- Syntax
- Functions
- Classes
- Existential Operator
- Loops, Comprehensions
The talk just skims the surface of the powerful (yet slim) CoffeeScript language. For further reading / real introductory tutorials, I would suggest:
- CoffeeScript Documentation: The official API.
- The CoffeeScript Cookbook: Lots of “recipes” for common programming problems and projects.
- Smooth Coffeescript: Interactive online eBook with live code execution and editing.