Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

CoffeeScript Style Guide

DZone's Guide to

CoffeeScript Style Guide

· Web Dev Zone ·
Free Resource

Learn how error monitoring with Sentry closes the gap between the product team and your customers. With Sentry, you can focus on what you do best: building and scaling software that makes your users’ lives better.

You may have come across the GitHub JavaScript Styleguide, which tells us to:


"Write new JS in CoffeeScript." 

 That alone is an awesome endorsement of the "little language", but there is more good advice:

"Follow @jashkenas's style. See the documentation for good examples." 

Without doubt, this is correct. The CoffeeScript home page should be your first stop for style. However, it's not strictly a style guide, so for a more dedicated resource I recommend  polarmobile/coffeescript-style-guide. It answers questions such as "tabs or spaces?", and I expect it will continue to grow, becoming a very comprehensive resource.


Of course, you could argue that in the age of computer automation, the best style guides are linters. CoffeeLint is described as "a style checker that helps keep CoffeeScript code clean and consistent." For style consistency across a team, it's likely to be a great choice.


Finally, as an example of good CoffeeScript style in the context of hairy, real-world programming, Jeremy Ashkenas recommends  the source code for the Pow server.


This list is by no means complete and is open for your contributions. Where do you go for great CoffeeScript style?

What’s the best way to boost the efficiency of your product team and ship with confidence? Check out this ebook to learn how Sentry's real-time error monitoring helps developers stay in their workflow to fix bugs before the user even knows there’s a problem.

Topics:

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}